separate dirs
This commit is contained in:
parent
217e9bce9c
commit
6c7f288bd8
1
ln.1
1
ln.1
|
@ -22,6 +22,5 @@ be linked into the given directory.
|
||||||
create a symbolic link.
|
create a symbolic link.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR cp (1),
|
.IR cp (1),
|
||||||
.IR mv (1),
|
|
||||||
.IR link (2),
|
.IR link (2),
|
||||||
.IR symlink (2)
|
.IR symlink (2)
|
||||||
|
|
7
ls.c
7
ls.c
|
@ -32,6 +32,7 @@ static bool aflag = false;
|
||||||
static bool dflag = false;
|
static bool dflag = false;
|
||||||
static bool lflag = false;
|
static bool lflag = false;
|
||||||
static bool tflag = false;
|
static bool tflag = false;
|
||||||
|
static bool first = true;
|
||||||
static bool many;
|
static bool many;
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -113,8 +114,12 @@ lsdir(const char *path)
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
qsort(ents, n, sizeof *ents, (int (*)(const void *, const void *))entcmp);
|
qsort(ents, n, sizeof *ents, (int (*)(const void *, const void *))entcmp);
|
||||||
|
|
||||||
if(many)
|
if(many) {
|
||||||
|
if(!first)
|
||||||
|
putchar('\n');
|
||||||
printf("%s:\n", path);
|
printf("%s:\n", path);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
for(i = 0; i < n; i++) {
|
for(i = 0; i < n; i++) {
|
||||||
output(&ents[i]);
|
output(&ents[i]);
|
||||||
free(ents[i].name);
|
free(ents[i].name);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user