diff options
author | Scott Graham <scottmg@chromium.org> | 2014-10-30 23:52:55 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2014-10-30 23:52:55 (GMT) |
commit | 95e087bdd959a6609b81359a68df4bd966ee2f0c (patch) | |
tree | a1ae35e370953e988c33616c5436a0e2f33cf20d | |
parent | 99ee3e818f1e7fa059b3ff0974521d2e427f1c35 (diff) | |
download | Ninja-95e087bdd959a6609b81359a68df4bd966ee2f0c.zip Ninja-95e087bdd959a6609b81359a68df4bd966ee2f0c.tar.gz Ninja-95e087bdd959a6609b81359a68df4bd966ee2f0c.tar.bz2 |
Use strchr in \ conversion in CanonicalizePath on Windows
-rw-r--r-- | src/util.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/util.cc b/src/util.cc index 66ef113..cb8adf1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -107,9 +107,8 @@ bool CanonicalizePath(char* path, size_t* len, string* err) { } #ifdef _WIN32 - for (char* c = path; *c; ++c) - if (*c == '\\') - *c = '/'; + for (char* c = path; (c = strchr(c, '\\')) != NULL;) + *c = '/'; #endif const int kMaxPathComponents = 30; |