From: Bruno Haible Date: Thu, 14 Aug 2008 11:20:08 +0000 (+0000) Subject: Require the same number of unnamed arguments also when !equality. X-Git-Tag: v0.18~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a3dd2e3ccaa530f3aa92af5d1fa5efa8dc33851;p=thirdparty%2Fgettext.git Require the same number of unnamed arguments also when !equality. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 97607c26a..ff17df51b 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2008-08-14 Bruno Haible + + * format-python.c (format_check): Require the same number of unnamed + arguments also when !equality. + Reported by Alexander Dupuy in + . + 2008-08-14 Bruno Haible * msgmerge.c: Include "glthread/lock.h" instead of "lock.h". diff --git a/gettext-tools/src/format-python.c b/gettext-tools/src/format-python.c index 722f3d99b..3a15b7352 100644 --- a/gettext-tools/src/format-python.c +++ b/gettext-tools/src/format-python.c @@ -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 , 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"),