]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Improve C format string verification.
authorBruno Haible <bruno@clisp.org>
Tue, 27 Mar 2001 17:04:37 +0000 (17:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 27 Mar 2001 17:04:37 +0000 (17:04 +0000)
src/ChangeLog
src/msgfmt.c
src/xgettext.c

index 7a494380df851bae6f88a5a4232a695f21a3a28d..33f109d0c73b95bb1681f49e4aa79738a4d4fff0 100644 (file)
@@ -1,3 +1,9 @@
+2001-03-26  Bruno Haible  <haible@clisp.cons.org>
+
+       * xgettext.c (test_whether_c_format): Recognize '%%' as valid.
+       * msgfmt.c (check_pair): In error message, count format
+       specifications starting from 1, not 0.
+
 2001-03-25  Bruno Haible  <haible@clisp.cons.org>
 
        * xgettext.c (warn_id_len): Remove unused variable.
index 35bd4fae4c66bda6cd3b2eb7cb535276cc2c5edd..5d23dc2acde0bb19c7de539229c7b0bd1a0261c8 100644 (file)
@@ -1013,7 +1013,7 @@ number of format specifications in `msgid' and `msgstr' does not match"));
                error_at_line (0, 0, msgid_pos->file_name,
                               msgid_pos->line_number, _("\
 format specifications for argument %lu are not the same"),
-                              (unsigned long) cnt);
+                              (unsigned long) (cnt + 1));
                exit_status = EXIT_FAILURE;
              }
        }
index 186b7cd2d33a36432a3c5c20cd17519f3ae6470d..d40c6ce5efb9ec47a1df3b14c031dd9cc75a95de 100644 (file)
@@ -1380,7 +1380,7 @@ test_whether_c_format (s)
       size_t dummy;
 
       (void) parse_one_spec (s, 0, &spec, &dummy);
-      if (strchr ("iduoxXeEfgGcspnm", spec.info.spec) == NULL)
+      if (strchr ("iduoxXeEfgGcspnm%", spec.info.spec) == NULL)
        return impossible;
     }