aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/ls.c')
-rw-r--r--toys/posix/ls.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index d6671923..a68533ff 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -186,15 +186,14 @@ static int filter(struct dirtree *new)
return 0;
}
- if (!(flags&FLAG_f)) {
- if (flags & FLAG_a) return 0;
- if (!(flags & FLAG_A) && new->name[0]=='.') return 0;
- }
-
if (flags & FLAG_u) new->st.st_mtime = new->st.st_atime;
if (flags & FLAG_c) new->st.st_mtime = new->st.st_ctime;
if (flags & FLAG_k) new->st.st_blocks = (new->st.st_blocks + 1) / 2;
- return dirtree_notdotdot(new);
+
+ if (flags & (FLAG_a|FLAG_f)) return DIRTREE_SAVE;
+ if (!(flags & FLAG_A) && new->name[0]=='.') return 0;
+
+ return dirtree_notdotdot(new) & DIRTREE_SAVE;
}
// For column view, calculate horizontal position (for padding) and return