From b470e7eb2674e53145fbc2b47a9ebf70acd5849d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 21 Jun 2025 23:45:59 +0200 Subject: [PATCH] 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. --- gettext-tools/src/format-boost.c | 2 +- gettext-tools/tests/format-boost-1 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 -- 2.47.3