Sfoglia il codice sorgente

makeAbsolutePath regression

Previous change to makeAbsolutePath (not in any labelled release) was not
behaving correctly on paths that did not exist, due to a missing clear().
This would cause any path that had more than one trailing component that
did not exist to be expanded incorrectly.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 anni fa
parent
commit
6091cb0ccb
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      system/jlib/jfile.cpp

+ 1 - 1
system/jlib/jfile.cpp

@@ -4927,7 +4927,7 @@ StringBuffer &makeAbsolutePath(const char *relpath,StringBuffer &out, bool mustE
                 }
                 if (tail == relpath)
                     break; // bail out and guess
-                head.append(tail-relpath, relpath);
+                head.clear().append(tail-relpath, relpath);
                 path = head.str();
             }
         }