summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-08-16 13:26:33 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-08-17 02:57:38 (GMT)
commitee44a510f448d130948380bd26926d3b17f5f11d (patch)
treeba770ec451beab0d7c6039a91fce4c83d3a25458 /src/util.cc
parenta9b7ae497faec86d5e413b46bb0b98c16a361c79 (diff)
downloadNinja-ee44a510f448d130948380bd26926d3b17f5f11d.zip
Ninja-ee44a510f448d130948380bd26926d3b17f5f11d.tar.gz
Ninja-ee44a510f448d130948380bd26926d3b17f5f11d.tar.bz2
on windows a network path starts with two backslashes
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc
index 7c2f895..4bd34e6 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -110,8 +110,19 @@ bool CanonicalizePath(char* path, int* len, string* err) {
const char* end = start + *len;
if (*src == '/') {
+#ifdef _WIN32
+ // network path starts with //
+ if (*len > 1 && *(src + 1) == '/') {
+ src += 2;
+ dst += 2;
+ } else {
+ ++src;
+ ++dst;
+ }
+#else
++src;
++dst;
+#endif
}
while (src < end) {