summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-01-16 19:01:34 +0900
committerDaiki Ueno <ueno@gnu.org>2015-01-16 19:05:22 +0900
commite6a77a185a35fd52dd80db71b120f6538a346e44 (patch)
tree8f003c499f316c0c748227f7924fcce356af977c /gettext-tools
parent28d7bcb5a8ed365752bc2a8ef1b10aa960f5d048 (diff)
downloadexternal_gettext-e6a77a185a35fd52dd80db71b120f6538a346e44.zip
external_gettext-e6a77a185a35fd52dd80db71b120f6538a346e44.tar.gz
external_gettext-e6a77a185a35fd52dd80db71b120f6538a346e44.tar.bz2
desktop: Avoid useless warning for group header
Reported by Marek Černocký at: <https://savannah.gnu.org/bugs/?44005> * gettext-tools/src/read-desktop.c (desktop_lex): Fix "invalid non-blank character" check after reading a group header. * gettext-tools/tests/xgettext-desktop-1: Check "invalid non-blank character" warning.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/src/ChangeLog8
-rw-r--r--gettext-tools/src/read-desktop.c15
-rw-r--r--gettext-tools/tests/ChangeLog4
-rwxr-xr-xgettext-tools/tests/xgettext-desktop-113
4 files changed, 31 insertions, 9 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index 0a4dbdb..7a96c18 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-16 Daiki Ueno <ueno@gnu.org>
+
+ desktop: Avoid useless warning for group header
+ Reported by Marek Černocký at:
+ <https://savannah.gnu.org/bugs/?44005>
+ * read-desktop.c (desktop_lex): Fix "invalid non-blank
+ character" check after reading a group header.
+
2015-01-13 Daiki Ueno <ueno@gnu.org>
* x-c.c (phase5_get): Reset raw_expected at the beginning of the
diff --git a/gettext-tools/src/read-desktop.c b/gettext-tools/src/read-desktop.c
index 8f9243b..be574ce 100644
--- a/gettext-tools/src/read-desktop.c
+++ b/gettext-tools/src/read-desktop.c
@@ -271,16 +271,13 @@ desktop_lex (token_ty *tp)
break;
}
/* Skip until newline. */
- if (c != '\n')
+ while (c != '\n' && c != EOF)
{
- for (;;)
- {
- if (c == '\n' || c == EOF)
- break;
- if (!c_isspace (c))
- non_blank = true;
- c = phase2_getc ();
- }
+ c = phase2_getc ();
+ if (c == EOF)
+ break;
+ if (!c_isspace (c))
+ non_blank = true;
}
if (non_blank)
po_xerror (PO_SEVERITY_WARNING, NULL,
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index f8cb454..a08f91d 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-16 Daiki Ueno <ueno@gnu.org>
+
+ * xgettext-desktop-1: Check "invalid non-blank character" warning.
+
2015-01-13 Daiki Ueno <ueno@gnu.org>
* xgettext-c-20: Improve test coverage of raw string tests.
diff --git a/gettext-tools/tests/xgettext-desktop-1 b/gettext-tools/tests/xgettext-desktop-1
index ae90879..c6f9df1 100755
--- a/gettext-tools/tests/xgettext-desktop-1
+++ b/gettext-tools/tests/xgettext-desktop-1
@@ -26,6 +26,19 @@ EOF
(LANGUAGE= LC_ALL=C ${XGETTEXT} --add-comments -o - err3.desktop 2>&1; exit) | grep "invalid non-blank line" || exit 1
+cat <<\EOF >err4.desktop
+[Desktop Entry]a
+EOF
+
+(LANGUAGE= LC_ALL=C ${XGETTEXT} --add-comments -o - err4.desktop 2>&1; exit) | grep "invalid non-blank character" || exit 1
+
+# gettext 0.19.4 issued an baseless warning of this.
+cat <<\EOF >ok4.desktop
+[Desktop Entry]
+EOF
+
+(LANGUAGE= LC_ALL=C ${XGETTEXT} --add-comments -o - ok4.desktop 2>&1; exit) | grep "invalid non-blank character" && exit 1
+
cat <<\EOF > xg.desktop
[Desktop Entry]
Type=Application