summaryrefslogtreecommitdiffstats
path: root/src/depfile_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/depfile_parser.cc')
-rw-r--r--src/depfile_parser.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/depfile_parser.cc b/src/depfile_parser.cc
index 98fba2e..7ce7290 100644
--- a/src/depfile_parser.cc
+++ b/src/depfile_parser.cc
@@ -54,6 +54,7 @@ bool DepfileParser::Parse(string* content, string* err) {
bool have_target = false;
bool parsing_targets = true;
bool poisoned_input = false;
+ bool is_empty = true;
while (in < end) {
bool have_newline = false;
// out: current output point (typically same as in, but can fall behind
@@ -335,6 +336,7 @@ yy32:
}
if (len > 0) {
+ is_empty = false;
StringPiece piece = StringPiece(filename, len);
// If we've seen this as an input before, skip it.
std::vector<StringPiece>::iterator pos = std::find(ins_.begin(), ins_.end(), piece);
@@ -363,7 +365,7 @@ yy32:
poisoned_input = false;
}
}
- if (!have_target) {
+ if (!have_target && !is_empty) {
*err = "expected ':' in depfile";
return false;
}