diff options
author | Evan Martin <martine@danga.com> | 2012-08-17 07:26:01 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-17 07:26:01 (GMT) |
commit | 413103c4c472410c10da179a841b5e3b05e576c0 (patch) | |
tree | d259ea30cba734d08bd2d58d75aa82110ae984ef /src/util.cc | |
parent | 5fe8c1308cf1785b1903eb11cf32909df3be113b (diff) | |
parent | ee44a510f448d130948380bd26926d3b17f5f11d (diff) | |
download | Ninja-413103c4c472410c10da179a841b5e3b05e576c0.zip Ninja-413103c4c472410c10da179a841b5e3b05e576c0.tar.gz Ninja-413103c4c472410c10da179a841b5e3b05e576c0.tar.bz2 |
Merge pull request #401 from syntheticpp/win-network-path
on windows a network path starts with two backslashes
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 14f6265..580f22a 100644 --- a/src/util.cc +++ b/src/util.cc @@ -110,8 +110,19 @@ bool CanonicalizePath(char* path, size_t* 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) { |