From: Bruno Haible Date: Sat, 21 Jun 2025 21:45:59 +0000 (+0200) Subject: boost-format: Accept null precision. X-Git-Tag: v0.26~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b470e7eb2674e53145fbc2b47a9ebf70acd5849d;p=thirdparty%2Fgettext.git boost-format: Accept null precision. * gettext-tools/src/format-boost.c: Fix comment regarding the precision. * gettext-tools/tests/format-boost-1: Add a test case with null precision. --- diff --git a/gettext-tools/src/format-boost.c b/gettext-tools/src/format-boost.c index f704772b9..a55b1a0c9 100644 --- a/gettext-tools/src/format-boost.c +++ b/gettext-tools/src/format-boost.c @@ -49,7 +49,7 @@ - optional: a width specification: '*' (reads an argument) or '*m$' or a nonempty digit sequence, - optional: a '.' and a precision specification: '*' (reads an - argument) or '*m$' or a nonempty digit sequence, + argument) or '*m$' or an optional nonempty digit sequence, - optional: any of the characters 'h', 'l', 'L', - if the directive started with '%|': an optional specifier and a final '|', diff --git a/gettext-tools/tests/format-boost-1 b/gettext-tools/tests/format-boost-1 index 717a79621..0d98ee1d0 100755 --- a/gettext-tools/tests/format-boost-1 +++ b/gettext-tools/tests/format-boost-1 @@ -160,6 +160,10 @@ cat <<\EOF > f-bo-1.data "abc%*0g" # Invalid: flags after width "abc%|*0g|" +# Valid: null precision +"abc%.f" +# Valid: null precision +"abc%|.f|" # Invalid: twice precision "abc%.4.2g" # Invalid: twice precision