aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/find.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/find.c')
-rw-r--r--toys/posix/find.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 3607874a..69e370d4 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -435,7 +435,7 @@ static int do_find(struct dirtree *new)
if (aa->dir && TT.topdir == -1) TT.topdir = xopen(".", 0);
// collect names and execute commands
- } else if (check) {
+ } else {
char *name, *ss1 = ss[1];
struct double_list **ddl;
@@ -443,11 +443,12 @@ static int do_find(struct dirtree *new)
aa = (void *)llist_pop(&argdata);
ss += aa->arglen + 1;
+ if (!check) goto cont;
// name is always a new malloc, so we can always free it.
name = aa->dir ? xstrdup(new->name) : dirtree_path(new, 0);
// Mark entry so COMEAGAIN can call flush_exec() in parent.
- // This is never a valid pointer valud for prev to have otherwise
+ // This is never a valid pointer value for prev to have otherwise
if (aa->dir) aa->prev = (void *)1;
if (*s == 'o') {