From cc87084959b1b33e3383df6fef3d80f1459e17ec Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 10 Nov 2020 22:16:30 +0100 Subject: [PATCH] Fixed a crash when searching recursively through a directory. --- es-core/src/utils/FileSystemUtil.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index d0915d4fb..5f41f8c45 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -73,8 +73,10 @@ namespace Utils std::string fullName(getGenericPath(path + "/" + name)); contentList.push_back(fullName); - if (_recursive && isDirectory(fullName)) + if (_recursive && isDirectory(fullName)) { + contentList.sort(); contentList.merge(getDirContent(fullName, true)); + } } } while (FindNextFileW(hFind, &findData)); @@ -94,8 +96,10 @@ namespace Utils std::string fullName(getGenericPath(path + "/" + name)); contentList.push_back(fullName); - if (_recursive && isDirectory(fullName)) + if (_recursive && isDirectory(fullName)) { + contentList.sort(); contentList.merge(getDirContent(fullName, true)); + } } } closedir(dir);