summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc
index 1dd9838..02be994 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -148,6 +148,11 @@ bool CanonicalizePath(char* path, int* len, string* err) {
src = sep + 1;
}
+ if (dst == start) {
+ *err = "path canonicalizes to the empty path";
+ return false;
+ }
+
*len = dst - start - 1;
return true;
}