Fix garbage output from ls on bad directory

This commit is contained in:
Kevin Lange 2015-04-01 09:08:08 -07:00
parent 9ec3d168f7
commit 632f13144f

View File

@ -399,10 +399,10 @@ int main (int argc, char * argv[]) {
printf("ls: cannot access %s: No such file or directory\n", p);
free(f);
out = 2;
} else {
list_insert(files, f);
}
list_insert(files, f);
optind++;
if (optind >= argc) p = NULL;
else p = argv[optind];