diff options
author | Scott Graham <scottmg@chromium.org> | 2014-11-10 20:00:16 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2014-11-10 20:00:16 (GMT) |
commit | c47506449cd4f6e44a7d43d9b7ecb33f3b448c16 (patch) | |
tree | 19868b1bc8634655d27dd73d1c9ad284c2816e04 /src/deps_log.cc | |
parent | fccce3f6731276f369e4454c59556998cdbb22d4 (diff) | |
download | Ninja-c47506449cd4f6e44a7d43d9b7ecb33f3b448c16.zip Ninja-c47506449cd4f6e44a7d43d9b7ecb33f3b448c16.tar.gz Ninja-c47506449cd4f6e44a7d43d9b7ecb33f3b448c16.tar.bz2 |
make all GetNode explicit, add DepsLog canonicalize test
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r-- | src/deps_log.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index 39de180..d889dfd 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -233,14 +233,20 @@ bool DepsLog::Load(const string& path, State* state, string* err) { if (!UpdateDeps(out_id, deps)) ++unique_dep_record_count; } else { - int path_size = size - 4; + size_t path_size = size - 4; assert(path_size > 0); // CanonicalizePath() rejects empty paths. // There can be up to 3 bytes of padding. if (buf[path_size - 1] == '\0') --path_size; if (buf[path_size - 1] == '\0') --path_size; if (buf[path_size - 1] == '\0') --path_size; + unsigned int slash_bits; + string err; + if (!CanonicalizePath(&buf[0], &path_size, &slash_bits, &err)) { + read_failed = true; + break; + } StringPiece path(buf, path_size); - Node* node = state->GetNode(path); + Node* node = state->GetNode(path, slash_bits); // Check that the expected index matches the actual index. This can only // happen if two ninja processes write to the same deps log concurrently. |