X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b1a4261e6d2c8b5eecf2f7be8c920f0a83feee42..d45708d4184fe4f1f6e5abd0e0bfaa18eff02f61:/src/scan-gram.l diff --git a/src/scan-gram.l b/src/scan-gram.l index 683d5822..61716810 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -1,7 +1,6 @@ /* Bison Grammar Scanner -*- C -*- - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software - Foundation, Inc. + Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -438,12 +437,9 @@ splice (\\[ \f\t\v]*\n)* } \\(.|\n) { char const *p = yytext + 1; - char quoted_ws[] = "` '"; - if (isspace (*p) && isprint (*p)) - { - quoted_ws[1] = *p; - p = quoted_ws; - } + /* Quote only if escaping won't make the character visible. */ + if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p)) + p = quote (p); else p = quotearg_style_mem (escape_quoting_style, p, 1); complain_at (*loc, _("invalid character after \\-escape: %s"), p);