diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-04-16 13:12:59 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-04-16 15:01:20 +0900 |
commit | 883786272828d68a25ddd6d0514f06ae5d8ae467 (patch) | |
tree | def59692c6220309f57eb132a161814a2ed81e13 | |
parent | 880a70213b9b79cc1062b8f7a0c26bd46ab75434 (diff) | |
download | gettext-883786272828d68a25ddd6d0514f06ae5d8ae467.tar.gz |
msgfmt: Allow any whitespace as a list separator in LINGUAS
-rw-r--r-- | gettext-tools/src/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/src/msgfmt.c | 24 |
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); |