diff options
author | 2012-06-04 12:00:59 -0700 | |
---|---|---|
committer | 2012-06-04 12:00:59 -0700 | |
commit | cc90f9cf803bc4aba928b2a80be451d9b717c5f0 (patch) | |
tree | 92644a80d4f288aaf380aef5b50ab724a47db456 /path.cpp | |
parent | 457e6a5f46a2529bd75305ae7b995a0f43f90654 (diff) |
path_make_canonical mishandles empty string.
Diffstat (limited to 'path.cpp')
-rw-r--r-- | path.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -525,8 +525,8 @@ void path_make_canonical( wcstring &path ) replace_all(path, L"//", L"/"); } while (path.size() != size); - /* Remove trailing slashes */ - while (size--) { + /* Remove trailing slashes, except don't remove the first one */ + while (size-- > 1) { if (path.at(size) != L'/') break; } |