Fixed a crash when searching recursively through a directory.

This commit is contained in:
Leon Styhre 2020-11-10 22:16:30 +01:00
parent 0bb8737211
commit cc87084959

View file

@ -73,10 +73,12 @@ namespace Utils
std::string fullName(getGenericPath(path + "/" + name)); std::string fullName(getGenericPath(path + "/" + name));
contentList.push_back(fullName); contentList.push_back(fullName);
if (_recursive && isDirectory(fullName)) if (_recursive && isDirectory(fullName)) {
contentList.sort();
contentList.merge(getDirContent(fullName, true)); contentList.merge(getDirContent(fullName, true));
} }
} }
}
while (FindNextFileW(hFind, &findData)); while (FindNextFileW(hFind, &findData));
FindClose(hFind); FindClose(hFind);
} }
@ -94,10 +96,12 @@ namespace Utils
std::string fullName(getGenericPath(path + "/" + name)); std::string fullName(getGenericPath(path + "/" + name));
contentList.push_back(fullName); contentList.push_back(fullName);
if (_recursive && isDirectory(fullName)) if (_recursive && isDirectory(fullName)) {
contentList.sort();
contentList.merge(getDirContent(fullName, true)); contentList.merge(getDirContent(fullName, true));
} }
} }
}
closedir(dir); closedir(dir);
} }
#endif #endif