Fix ls when -q is not set
Use strdup() unconditionally.
This commit is contained in:
parent
d40333e702
commit
e635760742
2
ls.c
2
ls.c
@ -209,7 +209,7 @@ lsdir(const char *path)
|
|||||||
output(&ent);
|
output(&ent);
|
||||||
} else {
|
} else {
|
||||||
ents = erealloc(ents, ++n * sizeof(*ents));
|
ents = erealloc(ents, ++n * sizeof(*ents));
|
||||||
name = p = emalloc(strlen(d->d_name) + 1);
|
name = p = estrdup(d->d_name);
|
||||||
if (qflag) {
|
if (qflag) {
|
||||||
q = d->d_name;
|
q = d->d_name;
|
||||||
while (*q) {
|
while (*q) {
|
||||||
|
Loading…
Reference in New Issue
Block a user