]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Require the same number of unnamed arguments also when !equality.
authorBruno Haible <bruno@clisp.org>
Thu, 14 Aug 2008 11:20:08 +0000 (11:20 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:46 +0000 (12:15 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/format-python.c

index 97607c26a01529c202f812dba3d433e037fe818c..ff17df51be117a9e37d4d2be9598f1d2c3757258 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-14  Bruno Haible  <bruno@clisp.org>
+
+       * format-python.c (format_check): Require the same number of unnamed
+       arguments also when !equality.
+       Reported by Alexander Dupuy <alex.dupuy@mac.com> in
+       <http://savannah.gnu.org/bugs/?24025>.
+
 2008-08-14  Bruno Haible  <bruno@clisp.org>
 
        * msgmerge.c: Include "glthread/lock.h" instead of "lock.h".
index 722f3d99bdb83e73ffc08ef5500a8bbdc326f208..3a15b7352007c2d5c84b3c2dede95d09ffadc2aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Python format strings.
-   Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2008 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -60,7 +60,9 @@
        - 'e', 'E', 'f', 'g', 'G', that need a floating-point argument.
    Use of '(ident)' and use of unnamed argument specifications are exclusive,
    because the first requires a mapping as argument, while the second requires
-   a tuple as argument.
+   a tuple as argument. When unnamed arguments are used, the number of
+   arguments in the format string and the number of elements in the argument
+   tuple (to the right of the '%' operator) must be the same.
  */
 
 enum format_arg_type
@@ -493,9 +495,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
          unsigned int i;
 
          /* Check the argument types are the same.  */
-         if (equality
-             ? spec1->unnamed_arg_count != spec2->unnamed_arg_count
-             : spec1->unnamed_arg_count < spec2->unnamed_arg_count)
+         if (spec1->unnamed_arg_count != spec2->unnamed_arg_count)
            {
              if (error_logger)
                error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),