From fd186cd16eafabfa28aa95175d8df97cbf08b0c7 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 25 Jul 2025 16:24:49 -0600 Subject: [PATCH] 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 ac7fe4dd4e9..11455b39502 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 643f04b9cef..6ca018d58f3 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 */