c-format: Accept null precision.

* gettext-tools/src/format-c-parse.h: Fix comment regarding the precision and
the ISO C23 size specifiers.
* gettext-tools/tests/format-c-1: Add a test case with null precision.
This commit is contained in:
Bruno Haible 2025-06-21 23:49:24 +02:00
parent b470e7eb26
commit 688d443b26
2 changed files with 4 additions and 2 deletions

View File

@ -28,10 +28,10 @@
- is optionally followed by a width specification: '*' (reads an argument)
or '*m$' or a nonempty digit sequence,
- is optionally followed by '.' and a precision specification: '*' (reads
an argument) or '*m$' or a nonempty digit sequence,
an argument) or '*m$' or an optional nonempty digit sequence,
- is either continued like this:
- is optionally followed by a size specifier, one of 'hh' 'h' 'l' 'll'
'L' 'q' 'j' 'z' 't',
'L' 'q' 'j' 'z' 't' 'w8' 'w16' 'w32' 'w64' 'wf8' 'wf16' 'wf32' 'wf64',
- is finished by a specifier
- '%', that needs no argument,
- 'c', 'C', that need a character argument,

View File

@ -178,6 +178,8 @@ cat <<\EOF > f-c-1.data
"abc%y"
# Invalid: flags after width
"abc%*0g"
# Valid: null precision
"abc%.f"
# Invalid: twice precision
"abc%.4.2g"
# Valid: three arguments