The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fd186cd16eafabfa28aa95175d8df97cbf08b0c7
commit fd186cd16eafabfa28aa95175d8df97cbf08b0c7 Author: Warner Losh <i...@freebsd.org> AuthorDate: 2025-07-25 22:24:49 +0000 Commit: Warner Losh <i...@freebsd.org> CommitDate: 2025-07-25 22:24:49 +0000 find: Fix items from the review I missed for printf Minor fixes I missed in a review comment until after the commit. Pointy-hat-to: imp Fixes: 7b9c912c41f4 Sponsored by: Netflix --- usr.bin/find/function.c | 5 ++++- usr.bin/find/printf.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index ac7fe4dd4e98..11455b395022 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1450,7 +1450,10 @@ c_printf(OPTION *option, char ***argvp) PLAN *new; isoutput = 1; - ftsoptions &= ~FTS_NOSTAT; + /* + * XXX We could scan the format looking for stat-dependent formats, and + * turn off the stat if there's none: `%p`/`%f`/`%h` don't need a stat. + */ new = palloc(option); new->c_data = nextarg(option, argvp); diff --git a/usr.bin/find/printf.c b/usr.bin/find/printf.c index 643f04b9cef5..6ca018d58f34 100644 --- a/usr.bin/find/printf.c +++ b/usr.bin/find/printf.c @@ -279,7 +279,7 @@ do_printf(PLAN *plan, FTSENT *entry, FILE *fout) case 'c': /* status change time ctime */ fp_ctime(fp, sb->st_ctime); break; - case 'C': /* statuc change time with next char strftime format */ + case 'C': /* status change time with next char strftime format */ fp_strftime(fp, sb->st_ctime, *fmt++); break; case 't': /* modification change time ctime */