Don't stop reading dir contents on errors

This commit is contained in:
Roy Marples 2007-10-08 12:46:14 +00:00
parent cd4bce7e8d
commit 3da2922358

View File

@ -54,8 +54,7 @@ static char **ls_dir (const char *dir, int options)
if ((dp = opendir (dir)) == NULL)
return (NULL);
errno = 0;
while (((d = readdir (dp)) != NULL) && errno == 0) {
while (((d = readdir (dp)) != NULL)) {
if (d->d_name[0] != '.') {
if (options & LS_INITD) {
int l = strlen (d->d_name);