--- ls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ls.c b/ls.c index 55dfe40..42811c5 100644 --- a/ls.c +++ b/ls.c _AT_@ -53,6 +53,7 @@ static int Uflag = 0; static int uflag = 0; static int first = 1; static char sort = 0; +static int showdirs; static void ls(const char *, const struct entry *, int); _AT_@ -277,7 +278,7 @@ lsdir(const char *path, const struct entry *dir) if (!Uflag) qsort(ents, n, sizeof(*ents), entcmp); - if (path[0] || dir->name[0] != '.') + if (path[0] || showdirs) printf("%s:\n", dir->name); for (i = 0; i < n; i++) output(&ents[i]); _AT_@ -469,6 +470,8 @@ main(int argc, char *argv[]) } } + showdirs = ds > 1 || (ds && fs); + qsort(fents, fs, sizeof(ent), entcmp); qsort(dents, ds, sizeof(ent), entcmp); -- 2.6.2Received on Sun May 15 2016 - 03:56:52 CEST
This archive was generated by hypermail 2.3.0 : Sun May 15 2016 - 04:02:41 CEST