diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-04-02 16:39:05 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-04-02 16:39:07 (GMT) |
commit | e2701da32d223f2ce165f2e59c2c396da80debc6 (patch) | |
tree | 37235867d7eee7e7438c1a46d0d7cb3a308f6dcb /src/depfile_parser.in.cc | |
parent | 7ab6dcbdb6447861eefafc47fc3e10f3273cede2 (diff) | |
download | Ninja-e2701da32d223f2ce165f2e59c2c396da80debc6.zip Ninja-e2701da32d223f2ce165f2e59c2c396da80debc6.tar.gz Ninja-e2701da32d223f2ce165f2e59c2c396da80debc6.tar.bz2 |
Dollar signs in depfiles are escaped as "$$", not "\$".
See http://llvm.org/PR15642. I checked that gcc does produce depfiles
containing "$$" for files with "$" signs in their name (and as of
r178540, so does clang). I also checked that .d files that escape dollar
signs with "\$" are not read correctly by make.
Diffstat (limited to 'src/depfile_parser.in.cc')
-rw-r--r-- | src/depfile_parser.in.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/depfile_parser.in.cc b/src/depfile_parser.in.cc index f96cdb3..cf24a09 100644 --- a/src/depfile_parser.in.cc +++ b/src/depfile_parser.in.cc @@ -55,13 +55,18 @@ bool DepfileParser::Parse(string* content, string* err) { re2c:indent:string = " "; nul = "\000"; - escape = [ \\#*$[|]; + escape = [ \\#*[|]; '\\' escape { // De-escape backslashed character. *out++ = yych; continue; } + '$$' { + // De-escape dollar character. + *out++ = '$'; + continue; + } '\\' [^\000\n] { // Let backslash before other characters through verbatim. *out++ = '\\'; |