summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src/read-catalog-abstract.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-10-22 01:42:25 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:15:22 +0200
commite1b1b593f018e8334300ce948d87c4fe42a402ea (patch)
tree8c6cb29d5878a57cb39ada7c56b2488e0e4aeb91 /gettext-tools/src/read-catalog-abstract.c
parentb4621cf20c4b8d6d5d4fba750d374c929128745c (diff)
downloadexternal_gettext-e1b1b593f018e8334300ce948d87c4fe42a402ea.zip
external_gettext-e1b1b593f018e8334300ce948d87c4fe42a402ea.tar.gz
external_gettext-e1b1b593f018e8334300ce948d87c4fe42a402ea.tar.bz2
Normalize the leading space of every comment line during the input phase
rather than during output.
Diffstat (limited to 'gettext-tools/src/read-catalog-abstract.c')
-rw-r--r--gettext-tools/src/read-catalog-abstract.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gettext-tools/src/read-catalog-abstract.c b/gettext-tools/src/read-catalog-abstract.c
index 56385ee..e78a031 100644
--- a/gettext-tools/src/read-catalog-abstract.c
+++ b/gettext-tools/src/read-catalog-abstract.c
@@ -1,5 +1,5 @@
/* Reading PO files, abstract class.
- Copyright (C) 1995-1996, 1998, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000-2007 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
@@ -649,7 +649,14 @@ void
po_callback_comment_dispatcher (const char *s)
{
if (*s == '.')
- po_callback_comment_dot (s + 1);
+ {
+ s++;
+ /* There is usually a space before the comment. People don't
+ consider it part of the comment, therefore remove it here. */
+ if (*s == ' ')
+ s++;
+ po_callback_comment_dot (s);
+ }
else if (*s == ':')
{
/* Parse the file location string. The appropriate callback will be
@@ -669,6 +676,12 @@ po_callback_comment_dispatcher (const char *s)
if (po_parse_comment_solaris_filepos (s))
/* Do nothing, it is a Sun-style file pos line. */ ;
else
- po_callback_comment (s);
+ {
+ /* There is usually a space before the comment. People don't
+ consider it part of the comment, therefore remove it here. */
+ if (*s == ' ')
+ s++;
+ po_callback_comment (s);
+ }
}
}