mirror of
https://https.git.savannah.gnu.org/git/gettext.git
synced 2026-01-26 15:39:11 +00:00
php-format: Reject null precision.
Rationale: The handling of null precision in php is buggy, cf. <https://github.com/php/php-src/issues/18897>. * gettext-tools/src/format-php.c: Fix comment regarding the precision. * gettext-tools/tests/format-php-1: Add a test case with null precision.
This commit is contained in:
parent
3c4aff9b3b
commit
c0a5ed0180
@ -40,8 +40,10 @@
|
||||
"'<anychar>", 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 <https://www.php.net/manual/en/function.sprintf.php>,
|
||||
but this is actually buggy: <https://github.com/php/php-src/issues/18897>.)
|
||||
- is optionally followed by a size specifier 'l', which is ignored,
|
||||
- is finished by a specifier
|
||||
- 's', that needs a string argument,
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user