aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-09-06 19:49:40 -0500
committerRob Landley <rob@landley.net>2012-09-06 19:49:40 -0500
commit85dd282b08eb378b4b8cc275f96226dc2c151216 (patch)
treefa897fd62a1f28eda88bcccbb0bfea69e7eadf4d
parent7c8103e5d2e472a2f11f6d6c6660c2903167fb7b (diff)
downloadtoybox-85dd282b08eb378b4b8cc275f96226dc2c151216.tar.gz
I screwed up ls in commit 580. Oops. Fix it.
-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