]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Support also \a and \v.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Jul 2004 13:16:41 +0000 (13:16 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:52 +0000 (12:11 +0200)
gettext-runtime/doc/ChangeLog
gettext-runtime/doc/rt-gettext.texi
gettext-runtime/doc/rt-ngettext.texi
gettext-runtime/src/ChangeLog
gettext-runtime/src/gettext.c
gettext-runtime/src/ngettext.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/tstgettext.c

index 9e7d3bba101de6fdd9504d3a1e41dd42a373c41e..1585b1c24c6364d7a1169a4dfeaf96866f0862d3 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-10  Bruno Haible  <bruno@clisp.org>
+
+       * rt-gettext.texi: Document also \a.
+       * rt-ngettext.texi: Likewise.
+
 2004-03-23  Bruno Haible  <bruno@clisp.org>
 
        * nls.texi: Small wording fixes,
index cd7f0bfd5fb4623453ecd6fd7ad9f2b2cd6526a8..7487478c01cabb38238ed476db4e5b7023a2c71c 100644 (file)
@@ -23,9 +23,9 @@ corresponds to a package, a program, or a module of a program.
 @opindex -e@r{, @code{gettext} option}
 Enable expansion of some escape sequences.  This option is for compatibility
 with the @samp{echo} program or shell built-in.  The escape sequences
-@samp{\b}, @samp{\c}, @samp{\f}, @samp{\n}, @samp{\r}, @samp{\t}, @samp{\v},
-@samp{\\}, and @samp{\} followed by one to three octal digits, are interpreted
-like the @samp{echo} program does.
+@samp{\a}, @samp{\b}, @samp{\c}, @samp{\f}, @samp{\n}, @samp{\r}, @samp{\t},
+@samp{\v}, @samp{\\}, and @samp{\} followed by one to three octal digits, are
+interpreted like the SystemV @samp{echo} program does.
 
 @item -E
 @opindex -E@r{, @code{gettext} option}
index 21e0151162f8893e2e9b985c06fb02b986f18170..e5df45deba2ba9dd6fbd2bec427b70e9a1f93dc4 100644 (file)
@@ -22,9 +22,9 @@ corresponds to a package, a program, or a module of a program.
 @opindex -e@r{, @code{ngettext} option}
 Enable expansion of some escape sequences.  This option is for compatibility
 with the @samp{gettext} program.  The escape sequences
-@samp{\b}, @samp{\c}, @samp{\f}, @samp{\n}, @samp{\r}, @samp{\t}, @samp{\v},
-@samp{\\}, and @samp{\} followed by one to three octal digits, are interpreted
-like the @samp{echo} program does.
+@samp{\a}, @samp{\b}, @samp{\c}, @samp{\f}, @samp{\n}, @samp{\r}, @samp{\t},
+@samp{\v}, @samp{\\}, and @samp{\} followed by one to three octal digits, are
+interpreted like the SystemV @samp{echo} program does.
 
 @item -E
 @opindex -E@r{, @code{ngettext} option}
index b9c97cab4d2748786b598dc5be71146db4eca43d..692ad6d4ec2d7ac3e02c04494e82e6ecddc3970e 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-10  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.c (expand_escape): Support also \a and \v.
+       * ngettext.c (expand_escape): Likewise.
+
 2004-02-02  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (RM): New variable.
index 98b5bde78f0b1517cd5078ceeaa0204b4a0330fe..6e3360f03f3e01364748f800d847592c49f57bda 100644 (file)
@@ -293,7 +293,7 @@ expand_escape (const char *str)
        ++cp;
     }
   while (cp[0] != '\0' && cp[1] != '\0'
-        && strchr ("bcfnrt\\01234567", cp[1]) == NULL);
+        && strchr ("abcfnrtv\\01234567", cp[1]) == NULL);
 
   if (cp[0] == '\0')
     return str;
@@ -307,6 +307,10 @@ expand_escape (const char *str)
     {
       switch (*++cp)
        {
+       case 'a':               /* alert */
+         *rp++ = '\a';
+         ++cp;
+         break;
        case 'b':               /* backspace */
          *rp++ = '\b';
          ++cp;
@@ -331,6 +335,10 @@ expand_escape (const char *str)
          *rp++ = '\t';
          ++cp;
          break;
+       case 'v':               /* vertical tab */
+         *rp++ = '\v';
+         ++cp;
+         break;
        case '\\':
          *rp = '\\';
          ++cp;
index 1997e327da2a70f73054890a576fcc8be1c43abf..f1747412409983d7add67c9733802427db275760 100644 (file)
@@ -259,7 +259,7 @@ expand_escape (const char *str)
        ++cp;
     }
   while (cp[0] != '\0' && cp[1] != '\0'
-        && strchr ("bfnrt\\01234567", cp[1]) == NULL);
+        && strchr ("abfnrtv\\01234567", cp[1]) == NULL);
 
   if (cp[0] == '\0')
     return str;
@@ -273,6 +273,10 @@ expand_escape (const char *str)
     {
       switch (*++cp)
        {
+       case 'a':               /* alert */
+         *rp++ = '\a';
+         ++cp;
+         break;
        case 'b':               /* backspace */
          *rp++ = '\b';
          ++cp;
@@ -293,6 +297,10 @@ expand_escape (const char *str)
          *rp++ = '\t';
          ++cp;
          break;
+       case 'v':               /* vertical tab */
+         *rp++ = '\v';
+         ++cp;
+         break;
        case '\\':
          *rp = '\\';
          ++cp;
index 9f6136ed1f3c9e6012614c09d311e117ecf6b7f2..d6a9f8524e8a467a1e0e3e379e1ea6cb20e10b1c 100644 (file)
@@ -1,3 +1,7 @@
+2004-07-10  Bruno Haible  <bruno@clisp.org>
+
+       * tstgettext.c (expand_escape): Support also \a and \v.
+
 2004-03-14  Bruno Haible  <bruno@clisp.org>
 
        * format-lisp-2: Add one more test for ~[...~].
index 103b8568fc5e9de0d317bc0b21e994504ada7b4e..fb93c925d4166386c142abaef40170a8d0f08dd8 100644 (file)
@@ -318,7 +318,7 @@ expand_escape (const char *str)
        ++cp;
     }
   while (cp[0] != '\0' && cp[1] != '\0'
-        && strchr ("bcfnrt\\01234567", cp[1]) == NULL);
+        && strchr ("abcfnrtv\\01234567", cp[1]) == NULL);
 
   if (cp[0] == '\0')
     return str;
@@ -332,6 +332,10 @@ expand_escape (const char *str)
     {
       switch (*++cp)
        {
+       case 'a':               /* alert */
+         *rp++ = '\a';
+         ++cp;
+         break;
        case 'b':               /* backspace */
          *rp++ = '\b';
          ++cp;
@@ -356,6 +360,10 @@ expand_escape (const char *str)
          *rp++ = '\t';
          ++cp;
          break;
+       case 'v':               /* vertical tab */
+         *rp++ = '\v';
+         ++cp;
+         break;
        case '\\':
          *rp = '\\';
          ++cp;