summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gettext-tools/src/ChangeLog5
-rw-r--r--gettext-tools/src/msgfmt.c24
2 files changed, 28 insertions, 1 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index f28668cd2..a2318e2aa 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -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
diff --git a/gettext-tools/src/msgfmt.c b/gettext-tools/src/msgfmt.c
index 3fa17aa67..46369204e 100644
--- a/gettext-tools/src/msgfmt.c
+++ b/gettext-tools/src/msgfmt.c
@@ -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);