diff options
author | Demi Obenour <demiobenour@gmail.com> | 2016-09-04 18:27:36 -0400 |
---|---|---|
committer | Demi Obenour <demiobenour@gmail.com> | 2016-09-04 18:29:30 -0400 |
commit | 7528bc0aee69c32fad8ffd8c84a4008627b7e445 (patch) | |
tree | cd950f876490dcfaee2866a8642477ea88321818 | |
parent | b22b8fdb973e8b540dd6bac4910d5f0d3a78f717 (diff) |
Fix escaping of `[[` and `]]` in strings
Previously, `[[` and `]]` were not escaped in strings, which led
to bad interactions with m4.
Also, don't break strings on newline, as GCC et al support whitespace
between a backslash and the subsequent newline.
-rw-r--r-- | src/scan.l | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -939,7 +939,9 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ <ACTION_STRING>{ [^"\\\n]+ ACTION_ECHO; \\. ACTION_ECHO; - {NL} ++linenum; ACTION_ECHO; BEGIN(ACTION); + {M4QEND} ACTION_ECHO_QEND; + {M4QSTART} ACTION_ECHO_QSTART; + {NL} ++linenum; ACTION_ECHO; \" ACTION_ECHO; BEGIN(ACTION); . ACTION_ECHO; } |