]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
desktop: Avoid useless warning for group header
authorDaiki Ueno <ueno@gnu.org>
Fri, 16 Jan 2015 10:01:34 +0000 (19:01 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 16 Jan 2015 10:05:22 +0000 (19:05 +0900)
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.

gettext-tools/src/ChangeLog
gettext-tools/src/read-desktop.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/xgettext-desktop-1

index 0a4dbdbeab8782eacafa6e7c539b2544fdc5e172..7a96c1858900385dead5f1fb6fd58f2000fb037f 100644 (file)
@@ -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
index 8f9243b350032b5670d4da42c29e6bf551ba7b5c..be574cec5ea939ef71d9dd03eda627e6bc58efd9 100644 (file)
@@ -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,
index f8cb454b36ee1509b80168b2c950d5f739b64988..a08f91d78e9ce1d0d76f7228e889a971ce7105fc 100644 (file)
@@ -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.
index ae908795cc2aac2fcf044b8e44393fccb2e9987a..c6f9df1cf7c7a9ec2330f2ac925a601ab11dffa5 100755 (executable)
@@ -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