summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build_test.cc3
-rw-r--r--src/depfile_parser.cc4
-rw-r--r--src/depfile_parser.in.cc4
-rw-r--r--src/depfile_parser_test.cc2
4 files changed, 10 insertions, 3 deletions
diff --git a/src/build_test.cc b/src/build_test.cc
index bd1cd30..82da57b 100644
--- a/src/build_test.cc
+++ b/src/build_test.cc
@@ -816,8 +816,7 @@ TEST_F(BuildTest, DepFileParseError) {
fs_.Create("foo.c", "");
fs_.Create("foo.o.d", "randomtext\n");
EXPECT_FALSE(builder_.AddTarget("foo.o", &err));
- EXPECT_EQ("expected depfile 'foo.o.d' to mention 'foo.o', got 'randomtext'",
- err);
+ EXPECT_EQ("foo.o.d: expected ':' in depfile", err);
}
TEST_F(BuildTest, OrderOnlyDeps) {
diff --git a/src/depfile_parser.cc b/src/depfile_parser.cc
index 4ca3943..7268f31 100644
--- a/src/depfile_parser.cc
+++ b/src/depfile_parser.cc
@@ -230,5 +230,9 @@ yy16:
return false;
}
}
+ if (parsing_targets) {
+ *err = "expected ':' in depfile";
+ return false;
+ }
return true;
}
diff --git a/src/depfile_parser.in.cc b/src/depfile_parser.in.cc
index b59baf0..deaee5b 100644
--- a/src/depfile_parser.in.cc
+++ b/src/depfile_parser.in.cc
@@ -112,5 +112,9 @@ bool DepfileParser::Parse(string* content, string* err) {
return false;
}
}
+ if (parsing_targets) {
+ *err = "expected ':' in depfile";
+ return false;
+ }
return true;
}
diff --git a/src/depfile_parser_test.cc b/src/depfile_parser_test.cc
index e67ef79..8b57a1e 100644
--- a/src/depfile_parser_test.cc
+++ b/src/depfile_parser_test.cc
@@ -106,7 +106,7 @@ TEST_F(DepfileParserTest, Escapes) {
// it through.
string err;
EXPECT_TRUE(Parse(
-"\\!\\@\\#$$\\%\\^\\&\\\\",
+"\\!\\@\\#$$\\%\\^\\&\\\\:",
&err));
ASSERT_EQ("", err);
EXPECT_EQ("\\!\\@#$\\%\\^\\&\\",