While the spec only allows spaces before and after '=',
xgettext/msgfmt previously accepted all whitespaces including '\n'.
That was causing unwanted concatenation of desktop lines.
Reported by Bastien Nocera in:
https://lists.gnu.org/archive/html/bug-gettext/2019-03/msg00017.html
* gettext-tools/src/read-desktop.c (desktop_lex): Properly handle
space characters before and after '='.
* gettext-tools/tests/msgfmt-desktop-1: Add a test case.
}
APPEND (0);
- /* Skip any whitespace before '='. */
+ /* Skip any space before '='. */
for (;;)
{
c = phase2_getc ();
switch (c)
{
default:
- if (c_isspace (c))
+ if (c == ' ')
continue;
phase2_ungetc (c);
break;
return;
}
- /* Skip any whitespace after '='. */
+ /* Skip any space after '='. */
for (;;)
{
c = phase2_getc ();
switch (c)
{
default:
- if (c_isspace (c))
+ if (c == ' ')
continue;
phase2_ungetc (c);
break;
- case EOF: case '\n':
+ case EOF:
break;
}
break;
Comment[foo]=Already translated comment
Comment= \sThis is a \nmultiline comment; for testing
Keywords=Keyword1;Keyword2;Key\;word3;
+Categories=
+NoDisplay=true
EOF
cat <<\EOF > fr.po
Comment=\sThis is a \nmultiline comment; for testing
Keywords[fr]=one;two;thr\;ee;
Keywords=Keyword1;Keyword2;Key\;word3;
+Categories=
+NoDisplay=true
EOF
# Sanity checks for contradicting options.