From: Bruno Haible Date: Mon, 7 May 2001 21:09:54 +0000 (+0000) Subject: Remove trailing whitespace from filename lists. X-Git-Tag: v0.11~734 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c719ff77dc52ed64c7902ae29ee3c62a8a46e9d4;p=thirdparty%2Fgettext.git Remove trailing whitespace from filename lists. --- diff --git a/src/ChangeLog b/src/ChangeLog index b0d75212e..97181e573 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-05-05 Karl Eichwalder + + * xgettext.c (read_name_from_file): Remove trailing space from line. + * msgcomm.c (read_name_from_file): Likewise. + 2001-05-02 Bruno Haible * po-charset.c: Don't include stdio.h, stdlib.h, mbswidth.h. Include diff --git a/src/msgcomm.c b/src/msgcomm.c index dbfcb80f8..a1eaf1a90 100644 --- a/src/msgcomm.c +++ b/src/msgcomm.c @@ -480,9 +480,14 @@ read_name_from_file (file_name) if (len < 0) break; - /* Remove trailing '\n'. */ + /* Remove trailing '\n' and trailing whitespace. */ if (len > 0 && line_buf[len - 1] == '\n') line_buf[--len] = '\0'; + while (len > 0 + && (line_buf[len - 1] == ' ' + || line_buf[len - 1] == '\t' + || line_buf[len - 1] == '\r')) + line_buf[--len] = '\0'; /* Test if we have to ignore the line. */ if (*line_buf == '\0' || *line_buf == '#') diff --git a/src/xgettext.c b/src/xgettext.c index ce1e716d7..492a31c9d 100644 --- a/src/xgettext.c +++ b/src/xgettext.c @@ -631,9 +631,14 @@ read_name_from_file (file_name) if (len < 0) break; - /* Remove trailing '\n'. */ + /* Remove trailing '\n' and trailing whitespace. */ if (len > 0 && line_buf[len - 1] == '\n') line_buf[--len] = '\0'; + while (len > 0 + && (line_buf[len - 1] == ' ' + || line_buf[len - 1] == '\t' + || line_buf[len - 1] == '\r')) + line_buf[--len] = '\0'; /* Test if we have to ignore the line. */ if (*line_buf == '\0' || *line_buf == '#')