]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msgfmt: Allow any whitespace as a list separator in LINGUAS
authorDaiki Ueno <ueno@gnu.org>
Wed, 16 Apr 2014 04:12:59 +0000 (13:12 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 16 Apr 2014 06:01:20 +0000 (15:01 +0900)
gettext-tools/src/ChangeLog
gettext-tools/src/msgfmt.c

index f28668cd215751660a51e72a4f727184bf6b7d3e..a2318e2aabc6d6f5aba5bedaa314c512b9d4ad3a 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-16  Daiki Ueno  <ueno@gnu.org>
+
+       * msgfmt.c (get_languages): Allow any whitespace character as a
+       list separator in LINGUAS.
+
 2014-04-15  Daiki Ueno  <ueno@gnu.org>
 
        msgfilter: Add 'quot' and 'boldquot' built-in filters
index 3fa17aa67475ed2d7b229e2d957fc5e61c4bc494..46369204ecd539596ecf1fc1d0b971408c587d1c 100644 (file)
@@ -1322,6 +1322,8 @@ get_languages (const char *directory)
 
       while (!feof (fp))
         {
+          char *start;
+
           /* Read next line from file.  */
           int len = getline (&line_buf, &line_len, fp);
 
@@ -1342,7 +1344,27 @@ get_languages (const char *directory)
           if (*line_buf == '\0' || *line_buf == '#')
             continue;
 
-          string_list_append_unique (languages, line_buf);
+          /* Split the line by whitespace and build the languages list.  */
+          start = line_buf;
+          while (*start != '\0')
+            {
+              char *end = start;
+              int c;
+
+              while (*end != '\0' && *end != ' ' && *end != '\t')
+                end++;
+
+              c = *end;
+              *end = '\0';
+              string_list_append_unique (languages, start);
+
+              if (c == '\0')
+                break;
+
+              start = end + 1;
+              while (*start == ' ' || *start == '\t')
+                start++;
+            }
         }
 
       free (line_buf);