]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
c-format: Accept null precision.
authorBruno Haible <bruno@clisp.org>
Sat, 21 Jun 2025 21:49:24 +0000 (23:49 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 21 Jun 2025 21:49:24 +0000 (23:49 +0200)
* 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.

gettext-tools/src/format-c-parse.h
gettext-tools/tests/format-c-1

index c0ea33395db2b75b090fcad64d82a55072484f96..da9d22549615a202ff16af3c1a9d2ace34e08fde 100644 (file)
    - 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,
index 64645ba4069d14ac37529b15dadad00175102224..4abc8be766e109e1a5143ceb38c87debf10b9fa8 100755 (executable)
@@ -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