From: Bruno Haible Date: Sun, 4 Nov 2018 23:21:56 +0000 (+0100) Subject: xgettext: C: Treat invalid escape sequences like GCC does. X-Git-Tag: v0.20~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da0fd87adf99893833f1c40e8a64802e5a1998a1;p=thirdparty%2Fgettext.git xgettext: C: Treat invalid escape sequences like GCC does. * gettext-tools/src/x-c.c (phase7_getc): For invalid escape sequences "\c", produce c, not a backslash. --- diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c index 0d43fc8d2..a81b85101 100644 --- a/gettext-tools/src/x-c.c +++ b/gettext-tools/src/x-c.c @@ -1028,11 +1028,8 @@ phase7_getc () switch (c) { default: - /* Unknown escape sequences really should be an error, but just - ignore them, and let the real compiler complain. */ - phase3_ungetc (c); - return '\\'; - + /* Invalid escape sequences generate a GCC warning, and GCC transforms + \c to the character c. So let's do the same. */ case '"': case '\'': case '?':