Make ForEachFile not crash

It still does not work with wildcards, but does nothing in that case now.
Günther Brammer 2009-05-08 21:06:50 +02:00
parent 4f811263fb
commit 145e647df1
1 changed files with 1 additions and 0 deletions

View File

@ -878,6 +878,7 @@ int ForEachFile(const char *szDirName, bool (*fnCallback)(const char *)) {
#else
if (fHasWildcard) fprintf(stderr, "Warning: ForEachFile with * (%s)", szDirName);
DIR * d = opendir(szDirName);
if (!d) return 0;
dirent * ent;
while ((ent = readdir(d))) {
SCopy(ent->d_name,GetFilename(szFilename));