]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Allow additional arguments in perl-bracket format strings.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Jun 2003 19:54:47 +0000 (19:54 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:45 +0000 (12:10 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/format-perl-bracket.c

index f9b1dfa45bc344f852ef399127e5768fec6be087..f67b9630e4f45300a56d3f8cad3090cff47a55fe 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-23  Bruno Haible  <bruno@clisp.org>
+
+       * format-perl-bracket.c (format_check): Allow additional bracketed
+       items in the msgstr.
+
 2003-06-22  Bruno Haible  <bruno@clisp.org>
 
        * write-properties.c: Don't include exit.h and gettext.h.
index 8c3991148ea70221861a191f23194f42af1070de..688fcfdc6ae9a82380c4572d06bd638a5dc27cbd 100644 (file)
@@ -181,8 +181,10 @@ format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
       unsigned int n1 = spec1->named_arg_count;
       unsigned int n2 = spec2->named_arg_count;
 
-      /* Check the argument names are the same.
-        Both arrays are sorted.  We search for the first difference.  */
+      /* Check the argument names in spec1 are contained in those of spec2.
+        Additional arguments in spec2 are allowed; they expand to themselves
+        (including the surrounding brackets) at runtime.
+        Both arrays are sorted.  We search for the differences.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
        {
          int cmp = (i >= n1 ? 1 :
@@ -190,18 +192,7 @@ format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
                     strcmp (spec1->named[i].name, spec2->named[j].name));
 
          if (cmp > 0)
-           {
-             if (noisy)
-               {
-                 error_with_progname = false;
-                 error_at_line (0, 0, pos->file_name, pos->line_number,
-                                _("a format specification for argument '%s', as in '%s', doesn't exist in 'msgid'"),
-                                spec2->named[j].name, pretty_msgstr);
-                 error_with_progname = true;
-               }
-             err = true;
-             break;
-           }
+           j++;
          else if (cmp < 0)
            {
              if (equality)