Skip to content

Commit

Permalink
find: tweak error message
Browse files Browse the repository at this point in the history
big find:
find: missing argument to `-exec'
we now say
find: -exec requires an argument
instead of the cryptic message we emitted previously.
Additional benefit is that it's now 23 bytes smaller.

Add TODO to add '-exec {} +' support

Signed-off-by: Bernhard Reutner-Fischer <[email protected]>
  • Loading branch information
aldot committed Feb 25, 2010
1 parent 8031848 commit 2e73d84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions findutils/find.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,14 @@ static action*** parse_params(char **argv)
ap->exec_argv = ++argv; /* first arg after -exec */
ap->exec_argc = 0;
while (1) {
if (!*argv) /* did not see ';' until end */
bb_error_msg_and_die("-exec CMD must end by ';'");
if (!*argv) /* did not see ';' or '+' until end */
bb_error_msg_and_die(bb_msg_requires_arg, "-exec");
if (LONE_CHAR(argv[0], ';'))
break;
//TODO: implement {} + (like xargs)
// See:
// find findutils/ -exec echo ">"{}"<" \;
// find findutils/ -exec echo ">"{}"<" +
argv++;
ap->exec_argc++;
}
Expand Down

0 comments on commit 2e73d84

Please sign in to comment.