Bug 1305037 - Simplify the declaration of slashp r?froydnj draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 23 Sep 2016 15:00:21 +0200
changeset 417005 980dcc2cfe74a998edfe7e26f125fe17646709fa
parent 397204 d320ef56876f52db9bc0eb79554c7332d4793769
child 417006 5135aeb9ada0e440f4d84e2526690c5b00cc7bd6
push id30308
push userbmo:sledru@mozilla.com
push dateFri, 23 Sep 2016 13:19:36 +0000
reviewersfroydnj
bugs1305037
milestone51.0a1
Bug 1305037 - Simplify the declaration of slashp r?froydnj MozReview-Commit-ID: BBax5TZdSDt
xpcom/io/nsLocalFileUnix.cpp
--- 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++;