aboutsummaryrefslogtreecommitdiffhomepage
path: root/path.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-04 12:00:59 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-04 12:00:59 -0700
commitcc90f9cf803bc4aba928b2a80be451d9b717c5f0 (patch)
tree92644a80d4f288aaf380aef5b50ab724a47db456 /path.cpp
parent457e6a5f46a2529bd75305ae7b995a0f43f90654 (diff)
path_make_canonical mishandles empty string.
Diffstat (limited to 'path.cpp')
-rw-r--r--path.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/path.cpp b/path.cpp
index 3dcfcadd..28f10838 100644
--- a/path.cpp
+++ b/path.cpp
@@ -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;
}