aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/chmod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/chmod.c b/toys/posix/chmod.c
index 2cdda951..ef74c4fa 100644
--- a/toys/posix/chmod.c
+++ b/toys/posix/chmod.c
@@ -50,7 +50,7 @@ static int do_chmod(struct dirtree *try)
// symlinks mentioned directly as arguments. We'll fail, of course,
// but that's what you asked for in that case.
} else {
- mode = string_to_mode(TT.mode, try->st.st_mode & ~S_IFMT);
+ mode = string_to_mode(TT.mode, try->st.st_mode) & ~S_IFMT;
if (FLAG(v)) {
char *s = dirtree_path(try, 0);