]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Output \a and \v as escape sequences.
authorBruno Haible <bruno@clisp.org>
Fri, 27 May 2005 11:06:52 +0000 (11:06 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:36 +0000 (12:12 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/write-po.c

index 2136ea6d83dd621d0474e9c2d134ddcba01c1bce..1245b60890f725cb07b94911af0b7eab187b69c3 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-27  Bruno Haible  <bruno@clisp.org>
+
+       * write-po.c (wrap): Output \a and \v as an escape sequence, like
+       \b, \f, \r.
+       Suggested by Asgeir Frimannsson <asgeirf@redhat.com>.
+
 2005-05-05  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (msgfmt_SOURCES): Add hash-string.c.
index 489f0ac75d7835d2ee68b5f47901ac80be5cca15..cebfd6aedc88515ff9b3beed1c695a917ecd60a3 100644 (file)
@@ -487,12 +487,10 @@ wrap (FILE *fp, const char *line_prefix, const char *name, const char *value,
   first_line = true;
   do
     {
-      /* The \a and \v escapes were added by the ANSI C Standard.
-        Prior to the Standard, most compilers did not have them.
-        Because we need the same program on all platforms we don't provide
-        support for them here.  Thus we only support \b\f\n\r\t.  */
+      /* The usual escapes, as defined by the ANSI C Standard.  */
 #     define is_escape(c) \
-       ((c) == '\b' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t')
+        ((c) == '\a' || (c) == '\b' || (c) == '\f' || (c) == '\n' \
+         || (c) == '\r' || (c) == '\t' || (c) == '\v')
 
       const char *es;
       const char *ep;
@@ -589,11 +587,13 @@ wrap (FILE *fp, const char *line_prefix, const char *name, const char *value,
            {
              switch (c)
                {
+               case '\a': c = 'a'; break;
                case '\b': c = 'b'; break;
                case '\f': c = 'f'; break;
                case '\n': c = 'n'; break;
                case '\r': c = 'r'; break;
                case '\t': c = 't'; break;
+               case '\v': c = 'v'; break;
                default: abort ();
                }
              *pp++ = '\\';