Bug 1468071. r=valentin, a=RyanVM
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 12 Jun 2018 10:50:39 -0400
changeset 473731 2eb17616fb879dc625b7194a4ff41ef1410a70d9
parent 473730 159957bbef8f0c8c4adcc461d3fd25a3dbf19b74
child 473732 728f6001d25ca6a9daf6779f833fe4b683d49945
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, RyanVM
bugs1468071
milestone61.0
Bug 1468071. r=valentin, a=RyanVM
xpcom/io/FilePreferences.cpp
--- a/xpcom/io/FilePreferences.cpp
+++ b/xpcom/io/FilePreferences.cpp
@@ -94,55 +94,57 @@ bool Normalizer::Get(nsAString& aNormali
 
   if (Check(mSeparator)) {
     aNormalizedFilePath.Append(mSeparator.AsChar());
   }
   if (Check(mSeparator)) {
     aNormalizedFilePath.Append(mSeparator.AsChar());
   }
 
-  if (!ConsumeName()) {
-    return false;
+  while (HasInput()) {
+    if (!ConsumeName()) {
+      return false;
+    }
   }
 
   for (auto const& name : mStack) {
     aNormalizedFilePath.Append(name);
   }
 
   return true;
 }
 
 bool Normalizer::ConsumeName()
 {
-  if (!HasInput() || CheckEOF()) {
+  if (CheckEOF()) {
     return true;
   }
 
   if (CheckCurrentDir()) {
-    return ConsumeName();
+    return true;
   }
 
   if (CheckParentDir()) {
     if (!mStack.Length()) {
       // This means there are more \.. than valid names
       return false;
     }
 
     mStack.RemoveLastElement();
-    return ConsumeName();
+    return true;
   }
 
   nsDependentSubstring name;
   if (ReadUntil(mSeparator, name, INCLUDE_LAST) && name.Length() == 1) {
     // this means and empty name (a lone slash), which is illegal
     return false;
   }
   mStack.AppendElement(name);
 
-  return ConsumeName();
+  return true;
 }
 
 bool Normalizer::CheckCurrentDir()
 {
   nsString::const_char_iterator cursor = mCursor;
   if (CheckChar('.') && CheckSeparator()) {
     return true;
   }