Reported at <https://savannah.gnu.org/bugs/index.php?48872>.
* gettext-tools/src/format-python-brace.c (format_check): Fix comment. Do the
cmp > 0 check also if equality==false.
* gettext-tools/src/format-python.c (format_check): Fix comment.
* gettext-tools/src/format-ruby.c (format_check): Likewise.
* gettext-tools/src/format-sh.c (format_check): Likewise.
/* Python brace format strings.
- Copyright (C) 2004, 2006-2007, 2013-2014, 2016, 2019, 2023 Free Software Foundation, Inc.
+ Copyright (C) 2004-2024 Free Software Foundation, Inc.
Written by Daiki Ueno <ueno@gnu.org>, 2013.
This program is free software: you can redistribute it and/or modify
unsigned int n1 = spec1->named_arg_count;
unsigned int n2 = spec2->named_arg_count;
- /* Check the argument names in spec1 are contained in those of spec2.
- Both arrays are sorted. We search for the differences. */
+ /* Check the argument names in spec2 are contained in those of spec1.
+ Both arrays are sorted. We search for the first difference. */
for (i = 0, j = 0; i < n1 || j < n2; )
{
int cmp = (i >= n1 ? 1 :
if (cmp > 0)
{
- if (equality)
- {
- if (error_logger)
- error_logger (error_logger_data,
- _("a format specification for argument '%s' doesn't exist in '%s'"),
- spec2->named[i].name, pretty_msgid);
- err = true;
- break;
- }
- else
- j++;
+ if (error_logger)
+ error_logger (error_logger_data,
+ _("a format specification for argument '%s', as in '%s', doesn't exist in '%s'"),
+ spec2->named[j].name, pretty_msgstr,
+ pretty_msgid);
+ err = true;
+ break;
}
else if (cmp < 0)
{
/* Python format strings.
- Copyright (C) 2001-2004, 2006-2009, 2019-2020, 2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 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
unsigned int n1 = spec1->named_arg_count;
unsigned int n2 = spec2->named_arg_count;
- /* Check that the argument names are the same.
+ /* Check the argument names in spec2 are contained in those of spec1.
Both arrays are sorted. We search for the first difference. */
for (i = 0, j = 0; i < n1 || j < n2; )
{
/* Ruby format strings.
- Copyright (C) 2001-2004, 2006-2009, 2019-2020, 2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2020.
This program is free software: you can redistribute it and/or modify
unsigned int n1 = spec1->named_arg_count;
unsigned int n2 = spec2->named_arg_count;
- /* Check that the argument names are the same.
+ /* Check the argument names in spec2 are contained in those of spec1.
Both arrays are sorted. We search for the first difference. */
for (i = 0, j = 0; i < n1 || j < n2; )
{
/* Shell format strings.
- Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
unsigned int n1 = spec1->named_arg_count;
unsigned int n2 = spec2->named_arg_count;
- /* Check that the argument names are the same.
+ /* Check the argument names in spec2 are contained in those of spec1.
Both arrays are sorted. We search for the first difference. */
for (i = 0, j = 0; i < n1 || j < n2; )
{