diff --git a/gettext-tools/src/format-php.c b/gettext-tools/src/format-php.c index 11b55a0d7..c1ec3abbb 100644 --- a/gettext-tools/src/format-php.c +++ b/gettext-tools/src/format-php.c @@ -40,8 +40,10 @@ "'", each of which acts as a flag, - is optionally followed by a width specification: a nonempty digit sequence, - - is optionally followed by '.' and a precision specification: a nonempty - digit sequence, + - is optionally followed by '.' and a precision specification: an [optional?] + nonempty digit sequence, + (It's optional per , + but this is actually buggy: .) - is optionally followed by a size specifier 'l', which is ignored, - is finished by a specifier - 's', that needs a string argument, diff --git a/gettext-tools/tests/format-php-1 b/gettext-tools/tests/format-php-1 index a7420375d..844be7ce4 100755 --- a/gettext-tools/tests/format-php-1 +++ b/gettext-tools/tests/format-php-1 @@ -54,6 +54,8 @@ cat <<\EOF > f-ph-1.data "abc%y" # Invalid: flags after width "abc%5-f" +# Invalid: null precision +"abc%.f" # Invalid: twice precision "abc%.4.2f" # Valid: three arguments