aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/find.test4
-rw-r--r--toys/posix/find.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/find.test b/tests/find.test
index de48c5c8..6b0b0a8a 100755
--- a/tests/find.test
+++ b/tests/find.test
@@ -56,6 +56,10 @@ testing "-type f -user -exec" \
"find dir -type f -user $USER -exec ls {} \\;" "dir/file\n" "" ""
testing "-type l -newer -exec" \
"find dir -type l -newer dir/file -exec ls {} \\;" "dir/link\n" "" ""
+testing "-exec true \\; -print" \
+ "find dir/file -exec true \\; -print" "dir/file\n" "" ""
+testing "-exec false \\; -print" \
+ "find dir/file -exec false \\; -print" "" "" ""
testing "-perm (exact success)" \
"find perm -type f -perm 0444" "perm/all-read-only\n" "" ""
testing "-perm (exact failure)" \
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 1c35155b..5cefbf15 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -530,7 +530,7 @@ static int do_find(struct dirtree *new)
aa->plus = 1;
toys.exitval |= flush_exec(new, aa);
}
- } else test = flush_exec(new, aa);
+ } else test = !flush_exec(new, aa);
}
// Argument consumed, skip the check.