struct dirent* direntp;
DL_CD_INIT();
scan_next:
- if ((direntp = readdir(cwd)) != NULL)
+ errno = 0;
+ direntp = readdir(cwd);
+ if (errno)
+ return -1;
+ if (direntp != NULL)
{ switch (direntp->d_type)
{ case DT_REG:
DPS_PUSH(direntp);
goto scan_next;
}
}
- if (errno)
- return -1;
qsort(lexer_direntpa, DPS_LEN(), sizeof direntp, (qcomp)alphasort);
return DPS_LEN();
}