summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-05-27 11:06:52 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:36 +0200
commit388e32899189083e1ae68ecba3fa7d939fe79468 (patch)
tree9dd2c55cf80a217e7327d6e4cda77260e12b5051
parentab8b926bd5966d64f2b897eb09ca6936d7780dd0 (diff)
downloadexternal_gettext-388e32899189083e1ae68ecba3fa7d939fe79468.zip
external_gettext-388e32899189083e1ae68ecba3fa7d939fe79468.tar.gz
external_gettext-388e32899189083e1ae68ecba3fa7d939fe79468.tar.bz2
Output \a and \v as escape sequences.
-rw-r--r--gettext-tools/src/ChangeLog6
-rw-r--r--gettext-tools/src/write-po.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index 2136ea6..1245b60 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -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.
diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c
index 489f0ac..cebfd6a 100644
--- a/gettext-tools/src/write-po.c
+++ b/gettext-tools/src/write-po.c
@@ -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++ = '\\';