summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-12-16 23:29:02 (GMT)
committerColin Cross <ccross@android.com>2015-12-16 23:35:53 (GMT)
commit5b910df397c6937552a6f3dee600da69c49702e2 (patch)
treea1d4e84664578f97ce51c2704449787f3fded85c /src/util.cc
parent4ffe56d387dce2bc5126fc4079ad2f2b31fba30e (diff)
downloadNinja-5b910df397c6937552a6f3dee600da69c49702e2.zip
Ninja-5b910df397c6937552a6f3dee600da69c49702e2.tar.gz
Ninja-5b910df397c6937552a6f3dee600da69c49702e2.tar.bz2
Canonicalize "." to "."
"." is a legal path, if the string is empty after canonicalization return ".".
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index d150fe2..e31fd1f 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -226,8 +226,8 @@ bool CanonicalizePath(char* path, size_t* len, unsigned int* slash_bits,
}
if (dst == start) {
- *err = "path canonicalizes to the empty path";
- return false;
+ *dst++ = '.';
+ *dst++ = '\0';
}
*len = dst - start - 1;