]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: C: Treat invalid escape sequences like GCC does.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Nov 2018 23:21:56 +0000 (00:21 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Nov 2018 23:25:35 +0000 (00:25 +0100)
* gettext-tools/src/x-c.c (phase7_getc): For invalid escape sequences "\c",
produce c, not a backslash.

gettext-tools/src/x-c.c

index 0d43fc8d2c4885c28959283b2d1ade89d7a0cf0e..a81b85101130445d3d2792c25e05051b95c60d1f 100644 (file)
@@ -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 '?':