aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/find.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index aca19845..f6701845 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -279,9 +279,9 @@ static int do_find(struct dirtree *new)
if (check) {
char *m = ss[1];
mode_t m1 = string_to_mode(m+(*m == '-'), 0),
- m2 = new->st.st_dev & 07777;
+ m2 = new->st.st_mode & 07777;
- if (*m != '-') m2 &= m1;
+ if (*m == '-') m2 &= m1;
test = m1 == m2;
}
} else if (!strcmp(s, "type")) {