diff options
author | Evan Martin <martine@danga.com> | 2011-05-17 23:35:32 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-17 23:35:32 (GMT) |
commit | b4bebb7ead0461529c9ff26cbb3db6b77a2643be (patch) | |
tree | 269503e6025d3e21c7ade2564eae4eeab89cef2f /src/util.cc | |
parent | 078f97b672b1b0f4293d8640a9ed4830c47c92ef (diff) | |
download | Ninja-b4bebb7ead0461529c9ff26cbb3db6b77a2643be.zip Ninja-b4bebb7ead0461529c9ff26cbb3db6b77a2643be.tar.gz Ninja-b4bebb7ead0461529c9ff26cbb3db6b77a2643be.tar.bz2 |
don't mangle absolute paths in the canonicalizer
We frequently do use absolute paths when depfiles refer to
e.g. /usr/include/stdio.h.
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc index e48c277..63d3800 100644 --- a/src/util.cc +++ b/src/util.cc @@ -79,7 +79,7 @@ bool CanonicalizePath(string* path, string* err) { string::size_type end = path->find('/', start); if (end == string::npos) end = path->size(); - if (end > start) { + if (end == 0 || end > start) { if (parts_count == kMaxPathComponents) { *err = "can't canonicalize path '" + *path + "'; too many " "path components"; |