summaryrefslogtreecommitdiffstats
path: root/src/depfile_parser.in.cc
diff options
context:
space:
mode:
authorMaciej Pawlowski <mpawlowski@opera.com>2018-11-07 09:42:07 (GMT)
committerMaciej Pawlowski <mpawlowski@opera.com>2018-11-07 10:22:37 (GMT)
commit3edc4d4110c327cf81f2d87214b707ced5b22cd2 (patch)
tree46ba850601d8739ec3932bcc6ad3c0512fadf663 /src/depfile_parser.in.cc
parentedb848dd6c0a2c0a12eb9e8676c3012fc94e80ca (diff)
downloadNinja-3edc4d4110c327cf81f2d87214b707ced5b22cd2.zip
Ninja-3edc4d4110c327cf81f2d87214b707ced5b22cd2.tar.gz
Ninja-3edc4d4110c327cf81f2d87214b707ced5b22cd2.tar.bz2
Fix parsing some special chars in depfiles
This allows paths with "[", "]" and "%" to appear in depfiles. Previously, only "[" would be handled properly. Fixes #1227.
Diffstat (limited to 'src/depfile_parser.in.cc')
-rw-r--r--src/depfile_parser.in.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/depfile_parser.in.cc b/src/depfile_parser.in.cc
index 98c1621..464efda 100644
--- a/src/depfile_parser.in.cc
+++ b/src/depfile_parser.in.cc
@@ -55,7 +55,7 @@ bool DepfileParser::Parse(string* content, string* err) {
re2c:indent:string = " ";
nul = "\000";
- escape = [ \\#*[|];
+ escape = [ \\#*[|\]];
'\\' escape {
// De-escape backslashed character.
@@ -73,7 +73,7 @@ bool DepfileParser::Parse(string* content, string* err) {
*out++ = yych;
continue;
}
- [a-zA-Z0-9+,/_:.~()}{@=!\x80-\xFF-]+ {
+ [a-zA-Z0-9+,/_:.~()}{%@=!\x80-\xFF-]+ {
// Got a span of plain text.
int len = (int)(in - start);
// Need to shift it over if we're overwriting backslashes.