From: Joel E. Denny Date: Sat, 22 Aug 2009 00:09:54 +0000 (-0400) Subject: Use locale when quoting. X-Git-Tag: v2.4.1a~26 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/321fe707f48f675a6b9f08f82c1f2bfdda808811 Use locale when quoting. * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use quote rather than implementing quoting here. (cherry picked from commit e6c849d82a95be8a595c254cc3046cfae725f064) --- diff --git a/ChangeLog b/ChangeLog index 9bf7137d..611091b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-21 Joel E. Denny + + 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 Make previous patch more robust. diff --git a/src/scan-gram.l b/src/scan-gram.l index 683d5822..7cb99f89 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -438,12 +438,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);