summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2014-10-30 23:52:55 (GMT)
committerScott Graham <scottmg@chromium.org>2014-10-30 23:52:55 (GMT)
commit95e087bdd959a6609b81359a68df4bd966ee2f0c (patch)
treea1ae35e370953e988c33616c5436a0e2f33cf20d /src
parent99ee3e818f1e7fa059b3ff0974521d2e427f1c35 (diff)
downloadNinja-95e087bdd959a6609b81359a68df4bd966ee2f0c.zip
Ninja-95e087bdd959a6609b81359a68df4bd966ee2f0c.tar.gz
Ninja-95e087bdd959a6609b81359a68df4bd966ee2f0c.tar.bz2
Use strchr in \ conversion in CanonicalizePath on Windows
Diffstat (limited to 'src')
-rw-r--r--src/util.cc5
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;