diff --git a/gettext-tools/src/format-pascal.c b/gettext-tools/src/format-pascal.c index 855acc614..648597501 100644 --- a/gettext-tools/src/format-pascal.c +++ b/gettext-tools/src/format-pascal.c @@ -49,8 +49,8 @@ - is optionally followed by a width specification: '*' (reads an argument, must be of type integer) or a nonempty digit sequence, - is optionally followed by '.' and a precision specification: '*' - (reads an argument, must be of type integer) or a nonempty digit - sequence, + (reads an argument, must be of type integer) or an optional nonempty + digit sequence, - is finished by a case-insensitive specifier. If no index was specified, it reads an argument; otherwise is uses the index-th argument, 0-based. @@ -216,8 +216,6 @@ format_parse (const char *format, bool translated, char *fdi, format++; } - else - --format; /* will jump to bad_format */ } switch (c_tolower (*format)) diff --git a/gettext-tools/tests/format-pascal-1 b/gettext-tools/tests/format-pascal-1 index c0694c087..98d2e5580 100755 --- a/gettext-tools/tests/format-pascal-1 +++ b/gettext-tools/tests/format-pascal-1 @@ -48,6 +48,8 @@ cat <<\EOF > f-op-1.data "abc%y" # Invalid: flags after width "abc%*-g" +# Valid: null precision +"abc%.f" # Invalid: twice precision "abc%.4.2g" # Valid: three arguments