summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
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) {