From: Bruno Haible Date: Sun, 11 Jul 2004 13:16:41 +0000 (+0000) Subject: Support also \a and \v. X-Git-Tag: v0.14.2~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6470b3ab2f405f197e105fbd7b05e719d20301ff;p=thirdparty%2Fgettext.git Support also \a and \v. --- diff --git a/gettext-runtime/doc/ChangeLog b/gettext-runtime/doc/ChangeLog index 9e7d3bba1..1585b1c24 100644 --- a/gettext-runtime/doc/ChangeLog +++ b/gettext-runtime/doc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-10 Bruno Haible + + * rt-gettext.texi: Document also \a. + * rt-ngettext.texi: Likewise. + 2004-03-23 Bruno Haible * nls.texi: Small wording fixes, diff --git a/gettext-runtime/doc/rt-gettext.texi b/gettext-runtime/doc/rt-gettext.texi index cd7f0bfd5..7487478c0 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 21e015116..e5df45deb 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 b9c97cab4..692ad6d4e 100644 --- a/gettext-runtime/src/ChangeLog +++ b/gettext-runtime/src/ChangeLog @@ -1,3 +1,8 @@ +2004-07-10 Bruno Haible + + * gettext.c (expand_escape): Support also \a and \v. + * ngettext.c (expand_escape): Likewise. + 2004-02-02 Bruno Haible * Makefile.am (RM): New variable. diff --git a/gettext-runtime/src/gettext.c b/gettext-runtime/src/gettext.c index 98b5bde78..6e3360f03 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 1997e327d..f17474124 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; diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 9f6136ed1..d6a9f8524 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,7 @@ +2004-07-10 Bruno Haible + + * tstgettext.c (expand_escape): Support also \a and \v. + 2004-03-14 Bruno Haible * format-lisp-2: Add one more test for ~[...~]. diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c index 103b8568f..fb93c925d 100644 --- a/gettext-tools/tests/tstgettext.c +++ b/gettext-tools/tests/tstgettext.c @@ -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;