]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Remove trailing whitespace from filename lists.
authorBruno Haible <bruno@clisp.org>
Mon, 7 May 2001 21:09:54 +0000 (21:09 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 7 May 2001 21:09:54 +0000 (21:09 +0000)
src/ChangeLog
src/msgcomm.c
src/xgettext.c

index b0d75212e5ee4b8793c109d4e9932a19d4824387..97181e573161a7f8f64b3d2851bd82e725aa2536 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-05  Karl Eichwalder  <ke@suse.de>
+
+       * xgettext.c (read_name_from_file): Remove trailing space from line.
+       * msgcomm.c (read_name_from_file): Likewise.
+
 2001-05-02  Bruno Haible  <haible@clisp.cons.org>
 
        * po-charset.c: Don't include stdio.h, stdlib.h, mbswidth.h. Include
index dbfcb80f8615b88236926657a35c0eaa6ad7bbe8..a1eaf1a90f60f3076d3d8ad24cf9ebf2c44557fa 100644 (file)
@@ -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 == '#')
index ce1e716d741d5fac740e56af1ba106fe1c616246..492a31c9d45dbb5b3cb7f56804cbb5f4f878e96f 100644 (file)
@@ -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 == '#')