From e1b1b593f018e8334300ce948d87c4fe42a402ea Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 22 Oct 2007 01:42:25 +0000 Subject: Normalize the leading space of every comment line during the input phase rather than during output. --- gettext-tools/src/read-catalog-abstract.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gettext-tools/src/read-catalog-abstract.c') 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 @@ -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); + } } } -- cgit v1.1