From 390ab130a1f2e44b7ed3f277229568e1014849c8 Mon Sep 17 00:00:00 2001 From: jmallett Date: Tue, 2 Apr 2002 07:20:56 +0000 Subject: Fix find -exec with no command specified (i.e.: find . -exec ';') PR: bin/36521 Submitted by: Simon 'corecode' Schubert Reviewed by: mike MFC after: 3 days --- usr.bin/find/function.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr.bin/find') diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 81b3475..4fe27dc 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -597,6 +597,9 @@ c_exec(option, argvp) break; } + if (ap == argv) + errx(1, "%s: no command specified", option->name); + cnt = ap - *argvp + 1; if ((new->e_argv = malloc((u_int)cnt * sizeof(char *))) == NULL) err(1, (char *)NULL); -- cgit v1.1