Revert "ls: only display directory headers when more than one directory is specified"

This reverts commit b107489bf2.
This commit is contained in:
Michael Forney 2016-05-14 18:56:51 -07:00 committed by sin
parent b91b9e79ec
commit e8e9b97baf
1 changed files with 2 additions and 3 deletions

5
ls.c
View File

@ -53,7 +53,6 @@ static int Uflag = 0;
static int uflag = 0; static int uflag = 0;
static int first = 1; static int first = 1;
static char sort = 0; static char sort = 0;
static size_t ds = 0;
static void ls(const char *, const struct entry *, int); static void ls(const char *, const struct entry *, int);
@ -278,7 +277,7 @@ lsdir(const char *path, const struct entry *dir)
if (!Uflag) if (!Uflag)
qsort(ents, n, sizeof(*ents), entcmp); qsort(ents, n, sizeof(*ents), entcmp);
if (ds > 1 && (path[0] || dir->name[0] != '.')) if (path[0] || dir->name[0] != '.')
printf("%s:\n", dir->name); printf("%s:\n", dir->name);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
output(&ents[i]); output(&ents[i]);
@ -369,7 +368,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
struct entry ent, *dents, *fents; struct entry ent, *dents, *fents;
size_t i, fs; size_t i, ds, fs;
ARGBEGIN { ARGBEGIN {
case '1': case '1':