Bug 1305037 - Simplify the declaration of slashp r?froydnj
MozReview-Commit-ID: BBax5TZdSDt
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1431,20 +1431,18 @@ nsLocalFile::GetParent(nsIFile** aParent
// if '/' we are at the top of the volume, return null
if (mPath.EqualsLiteral("/")) {
return NS_OK;
}
// <brendan, after jband> I promise to play nice
char* buffer = mPath.BeginWriting();
- char* slashp = buffer;
-
// find the last significant slash in buffer
- slashp = strrchr(buffer, '/');
+ char* slashp = strrchr(buffer, '/');
NS_ASSERTION(slashp, "non-canonical path?");
if (!slashp) {
return NS_ERROR_FILE_INVALID_PATH;
}
// for the case where we are at '/'
if (slashp == buffer) {
slashp++;