comparison toys/posix/ls.c @ 663:60cbc87c4314

I screwed up ls in commit 580. Oops. Fix it.
author Rob Landley <rob@landley.net>
date Thu, 06 Sep 2012 19:49:40 -0500
parents 6df4ccc0acbe
children 7e846e281e38
comparison
equal deleted inserted replaced
662:5cb41d56f9d3 663:60cbc87c4314
184 if (flags == (FLAG_1|FLAG_f)) { 184 if (flags == (FLAG_1|FLAG_f)) {
185 xprintf("%s\n", new->name); 185 xprintf("%s\n", new->name);
186 return 0; 186 return 0;
187 } 187 }
188 188
189 if (!(flags&FLAG_f)) {
190 if (flags & FLAG_a) return 0;
191 if (!(flags & FLAG_A) && new->name[0]=='.') return 0;
192 }
193
194 if (flags & FLAG_u) new->st.st_mtime = new->st.st_atime; 189 if (flags & FLAG_u) new->st.st_mtime = new->st.st_atime;
195 if (flags & FLAG_c) new->st.st_mtime = new->st.st_ctime; 190 if (flags & FLAG_c) new->st.st_mtime = new->st.st_ctime;
196 if (flags & FLAG_k) new->st.st_blocks = (new->st.st_blocks + 1) / 2; 191 if (flags & FLAG_k) new->st.st_blocks = (new->st.st_blocks + 1) / 2;
197 return dirtree_notdotdot(new); 192
193 if (flags & (FLAG_a|FLAG_f)) return DIRTREE_SAVE;
194 if (!(flags & FLAG_A) && new->name[0]=='.') return 0;
195
196 return dirtree_notdotdot(new) & DIRTREE_SAVE;
198 } 197 }
199 198
200 // For column view, calculate horizontal position (for padding) and return 199 // For column view, calculate horizontal position (for padding) and return
201 // index of next entry to display. 200 // index of next entry to display.
202 201