From 890ab17c84437fcfc56195e72484110c5c231a46 Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Fri, 21 Aug 2009 20:09:54 -0400 Subject: [PATCH] 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) --- ChangeLog | 6 ++++++ src/scan-gram.l | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b7631bd..853777a1 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 9aec298e..f0f8c279 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -560,12 +560,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); -- 2.45.2