printf: add indexed argument support
commit5cecd703e57b2e1301767d82cbe5bb01cae88472
authorPádraig Brady <P@draigBrady.com>
Wed, 11 Sep 2024 15:07:48 +0000 (11 16:07 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 13 Sep 2024 16:29:02 +0000 (13 17:29 +0100)
treec672e2c034816a4afb447c5ba927f3818a50487e
parent408301e4bc171bf5544f373f64bb6ed3351541db
printf: add indexed argument support

* src/printf.c (print_formatted): Add support for %i$ indexed args.
* tests/printf/printf-indexed.sh: Add a new file of test cases.
* tests/local.mk: Reference the new test file.
* doc/coreutils.texi (printf invocation): Mention how mixed
processing of indexed and sequential references are supported,
unlike the printf(2) library function.
* NEWS: Mention the new (POSIX:2024) feature.
Addresses https://bugs.gnu.org/73068
NEWS
doc/coreutils.texi
src/printf.c
tests/local.mk
tests/printf/printf-indexed.sh [new file with mode: 0755]