--- find.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/find.c b/find.c index 0f57e03..339e2a9 100644 --- a/find.c +++ b/find.c _AT_@ -133,6 +133,7 @@ static int pri_mtime (struct arg *arg); static int pri_exec (struct arg *arg); static int pri_ok (struct arg *arg); static int pri_print (struct arg *arg); +static int pri_print0 (struct arg *arg); static int pri_newer (struct arg *arg); static int pri_depth (struct arg *arg); _AT_@ -191,6 +192,7 @@ static struct pri_info primaries[] = { { "-exec" , pri_exec , get_exec_arg , free_exec_arg, 1 }, { "-ok" , pri_ok , get_ok_arg , free_ok_arg , 1 }, { "-print" , pri_print , get_print_arg, NULL , 0 }, + { "-print0" , pri_print0 , get_print_arg, NULL , 0 }, { "-newer" , pri_newer , get_newer_arg, NULL , 1 }, { "-depth" , pri_depth , get_depth_arg, NULL , 0 }, _AT_@ -475,6 +477,14 @@ pri_print(struct arg *arg) return 1; } +static int +pri_print0(struct arg *arg) +{ + if (fwrite(arg->path, strlen(arg->path) + 1, 1, stdout) != 1) + eprintf("fwrite failed:"); + return 1; +} + /* FIXME: ignoring nanoseconds */ static int pri_newer(struct arg *arg) _AT_@ -678,6 +688,13 @@ get_print_arg(char *argv[], union extra *extra) return argv; } +static char ** +get_print0_arg(char *argv[], union extra *extra) +{ + gflags.print = 0; + return argv; +} + /* FIXME: ignoring nanoseconds */ static char ** get_newer_arg(char *argv[], union extra *extra) -- 2.48.1Received on Fri Feb 14 2025 - 17:25:09 CET
This archive was generated by hypermail 2.3.0 : Sun Feb 16 2025 - 02:48:38 CET