mirror of
https://https.git.savannah.gnu.org/git/gettext.git
synced 2026-01-26 15:39:11 +00:00
elisp-format: Accept null precision.
Proof that is is valid: (format "%.f" 3.1415926) * gettext-tools/src/format-elisp.c: Fix comment regarding the precision. * gettext-tools/tests/format-elisp-1: Add a test case with null precision.
This commit is contained in:
parent
36f19a58d5
commit
d29d2aa61a
@ -31,8 +31,8 @@
|
||||
|
||||
#define _(str) gettext (str)
|
||||
|
||||
/* Emacs Lisp format strings are implemented in emacs-21.1/src/editfns.c,
|
||||
xemacs-21.1.14/src/editfns.c and xemacs-21.1.14/src/doprnt.c.
|
||||
/* Emacs Lisp format strings are implemented in emacs-21.4/src/editfns.c and
|
||||
emacs-21.4/src/doprnt.c.
|
||||
A directive
|
||||
- starts with '%' or '%m$' where m is a positive integer,
|
||||
- is optionally followed by any of the characters '#', '0', '-', ' ', '+',
|
||||
@ -40,7 +40,7 @@
|
||||
- is optionally followed by a width specification: '*' (reads an argument)
|
||||
or a nonempty digit sequence,
|
||||
- is optionally followed by '.' and a precision specification: '*' (reads
|
||||
an argument) or a nonempty digit sequence,
|
||||
an argument) or an optional nonempty digit sequence,
|
||||
- is finished by a specifier
|
||||
- '%', that needs no argument,
|
||||
- 'c', that need a character argument,
|
||||
|
||||
@ -54,6 +54,8 @@ cat <<\EOF > f-el-1.data
|
||||
"abc%y"
|
||||
# Invalid: flags after width
|
||||
"abc%2^d"
|
||||
# Valid: null precision
|
||||
"abc%.f"
|
||||
# Invalid: twice precision
|
||||
"abc%.4.2d"
|
||||
# Valid: three arguments
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user