summaryrefslogtreecommitdiffstats
path: root/gettext-runtime
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2004-07-11 13:16:41 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:11:52 +0200
commit6470b3ab2f405f197e105fbd7b05e719d20301ff (patch)
treeec8796dfb5fef3244b593bdb321796b5b445e247 /gettext-runtime
parent1dfbf6f2883aa834389a2a8384c8764a15110ca6 (diff)
downloadexternal_gettext-6470b3ab2f405f197e105fbd7b05e719d20301ff.zip
external_gettext-6470b3ab2f405f197e105fbd7b05e719d20301ff.tar.gz
external_gettext-6470b3ab2f405f197e105fbd7b05e719d20301ff.tar.bz2
Support also \a and \v.
Diffstat (limited to 'gettext-runtime')
-rw-r--r--gettext-runtime/doc/ChangeLog5
-rw-r--r--gettext-runtime/doc/rt-gettext.texi6
-rw-r--r--gettext-runtime/doc/rt-ngettext.texi6
-rw-r--r--gettext-runtime/src/ChangeLog5
-rw-r--r--gettext-runtime/src/gettext.c10
-rw-r--r--gettext-runtime/src/ngettext.c10
6 files changed, 34 insertions, 8 deletions
diff --git a/gettext-runtime/doc/ChangeLog b/gettext-runtime/doc/ChangeLog
index 9e7d3bb..1585b1c 100644
--- a/gettext-runtime/doc/ChangeLog
+++ b/gettext-runtime/doc/ChangeLog
@@ -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,
diff --git a/gettext-runtime/doc/rt-gettext.texi b/gettext-runtime/doc/rt-gettext.texi
index cd7f0bf..7487478 100644
--- a/gettext-runtime/doc/rt-gettext.texi
+++ b/gettext-runtime/doc/rt-gettext.texi
@@ -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}
diff --git a/gettext-runtime/doc/rt-ngettext.texi b/gettext-runtime/doc/rt-ngettext.texi
index 21e0151..e5df45d 100644
--- a/gettext-runtime/doc/rt-ngettext.texi
+++ b/gettext-runtime/doc/rt-ngettext.texi
@@ -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}
diff --git a/gettext-runtime/src/ChangeLog b/gettext-runtime/src/ChangeLog
index b9c97ca..692ad6d 100644
--- a/gettext-runtime/src/ChangeLog
+++ b/gettext-runtime/src/ChangeLog
@@ -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.
diff --git a/gettext-runtime/src/gettext.c b/gettext-runtime/src/gettext.c
index 98b5bde..6e3360f 100644
--- a/gettext-runtime/src/gettext.c
+++ b/gettext-runtime/src/gettext.c
@@ -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;
diff --git a/gettext-runtime/src/ngettext.c b/gettext-runtime/src/ngettext.c
index 1997e32..f174741 100644
--- a/gettext-runtime/src/ngettext.c
+++ b/gettext-runtime/src/ngettext.c
@@ -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;