aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-07-30 03:40:38 -0500
committerRob Landley <rob@landley.net>2020-07-30 03:40:38 -0500
commitd2ad946f2af729890e80d0e9228f23a0ca62a450 (patch)
tree5baff1f2eb272d33e8b6e2aa53de7e8c9743c1e1 /toys/posix
parent70a55cf954ecabb858a12b754f4547bcaf78dc2d (diff)
downloadtoybox-d2ad946f2af729890e80d0e9228f23a0ca62a450.tar.gz
Don't need "match", just test *t.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/find.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 47cefb78..ff127b91 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -398,19 +398,16 @@ static int do_find(struct dirtree *new)
} else if (!strcmp(s, "type")) {
if (check) {
int types[] = {S_IFBLK, S_IFCHR, S_IFDIR, S_IFLNK, S_IFIFO,
- S_IFREG, S_IFSOCK}, i, match = 0;
+ S_IFREG, S_IFSOCK}, i;
char *t = ss[1];
for (; *t; t++) {
if (*t == ',') continue;
i = stridx("bcdlpfs", *t);
if (i<0) error_exit("bad -type '%c'", *t);
- if ((new->st.st_mode & S_IFMT) == types[i]) {
- match = 1;
- break;
- }
+ if ((new->st.st_mode & S_IFMT) == types[i]) break;
}
- if (!match) test = 0;
+ test = *t;
}
} else if (strchr("acm", *s)