uutils/findutils

-printf: unrecognized %X / \X directives should warn and print literally, not be dropped or error

Offen

#815 geöffnet am 07.08.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (96 Forks)user submission
good first issue

Repository-Metriken

Stars
 (635 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 26T 6h) (46 gemergte PRs in 30 T)

Beschreibung

GNU findutils treats an unrecognized -printf directive as a warning and prints the directive text verbatim, exiting 0. uutils/findutils diverges in two ways.

%X - the % is silently dropped

$ # GNU findutils 4.10.0
$ find d -printf '%€|\n'
find: warning: unrecognized format directive '%€'
%€|
$ echo $?
0

$ # uutils
$ find d -printf '%€|\n'
€|
$ echo $?
0

The % disappears. Same for the ASCII case, e.g. %q.

\X - uutils errors instead of warning

$ # GNU: warns, prints `\€`, exit 0
$ # uutils: hard error, exit 1

Contributor Guide