diff options
author | Evan Martin <martine@danga.com> | 2011-10-06 00:51:06 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-10-06 00:51:06 (GMT) |
commit | e54d2b6c8bbb78b238160c7f31ae8515c15183d9 (patch) | |
tree | 2566a133dfda2675b55c896dbf22f95a7bbfced5 /src/ninja.cc | |
parent | 06ab305be33ff4899016c746ee8a3557291ebe09 (diff) | |
download | Ninja-e54d2b6c8bbb78b238160c7f31ae8515c15183d9.zip Ninja-e54d2b6c8bbb78b238160c7f31ae8515c15183d9.tar.gz Ninja-e54d2b6c8bbb78b238160c7f31ae8515c15183d9.tar.bz2 |
make CanonicalizePath report an error on empty path
Fixes part of issue 121, but the fix exposed a further issue.
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index c70aa43..6dc2766 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -116,7 +116,8 @@ struct RealFileReader : public ManifestParser::FileReader { bool RebuildManifest(State* state, const BuildConfig& config, const char* input_file, string* err) { string path = input_file; - CanonicalizePath(&path); + if (!CanonicalizePath(&path, err)) + return false; Node* node = state->LookupNode(path); if (!node) return false; @@ -139,7 +140,8 @@ bool CollectTargetsFromArgs(State* state, int argc, char* argv[], } else { for (int i = 0; i < argc; ++i) { string path = argv[i]; - CanonicalizePath(&path); + if (!CanonicalizePath(&path, err)) + return false; // Special syntax: "foo.cc^" means "the first output of foo.cc". bool first_dependent = false; |