uutils/findutils

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

開放

#815 建立於 2026年8月7日

 (0 則留言) (0 個反應) (0 位負責人)Rust (96 個分叉)user submission
good first issue

倉庫指標

星標
 (635 顆星)
PR 合併指標
 (平均合併 26天 6小時) (30 天內合併 46 個 PR)

描述

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

貢獻者指南