diff options
author | Joel E. Denny <jdenny@clemson.edu> | 2009-08-21 20:09:54 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny@clemson.edu> | 2009-08-21 20:17:56 -0400 |
commit | e6c849d82a95be8a595c254cc3046cfae725f064 (patch) | |
tree | 3daf6ff73b34d96e921a101cc3edec26a421008a | |
parent | b0778bdd0c2c7d5136f46ffe5c00b4c9153d5169 (diff) | |
download | bison-e6c849d82a95be8a595c254cc3046cfae725f064.tar.gz |
Use locale when quoting.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
quote rather than implementing quoting here.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/scan-gram.l | 7 |
2 files changed, 8 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2009-08-21 Joel E. Denny <jdenny@clemson.edu> + + Use locale when quoting. + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use + quote rather than implementing quoting here. + 2009-08-20 Eric Blake <ebb9@byu.net> Make previous patch more robust. diff --git a/src/scan-gram.l b/src/scan-gram.l index 4ed30c6f..93e0d103 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -617,12 +617,9 @@ splice (\\[ \f\t\v]*\n)* } \\(.|\n) { char const *p = yytext + 1; - char quoted_ws[] = "` '"; + /* Quote only if escaping won't make the character visible. */ if (isspace (*p) && isprint (*p)) - { - quoted_ws[1] = *p; - p = quoted_ws; - } + p = quote (p); else p = quotearg_style_mem (escape_quoting_style, p, 1); complain_at (*loc, _("invalid character after \\-escape: %s"), p); |