aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2024-04-26 10:52:02 -0500
committerRob Landley <rob@landley.net>2024-04-26 10:52:02 -0500
commitddd83be0a4f45bf87904e4dd9d5f7e270be58c35 (patch)
tree2183c7ac8a48d7edfe372ef2a8b1c8a529ec46d4 /toys
parentaedbaa5c4d451859b0e8b470e9520f722915bda0 (diff)
downloadtoybox-ddd83be0a4f45bf87904e4dd9d5f7e270be58c35.tar.gz
find -size implies -type f.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/find.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 0fde9c9e..c8e68683 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -438,7 +438,8 @@ static int do_find(struct dirtree *new)
if (*ss != arg) free(arg);
}
} else if (!strcmp(s, "size")) {
- if (check) test = compare_numsign(new->st.st_size, 512, arg);
+ if (check) test = compare_numsign(new->st.st_size, -512, arg) &&
+ ((new->st.st_mode & S_IFMT) == S_IFREG);
} else if (!strcmp(s, "links")) {
if (check) test = compare_numsign(new->st.st_nlink, 0, arg);
} else if (!strcmp(s, "inum")) {