|
@@ -501,10 +501,13 @@ void FileSystem::ScanDirInternal(Vector<String>& result, String path, const Stri
|
|
|
if (path.Length() > startPath.Length())
|
|
if (path.Length() > startPath.Length())
|
|
|
deltaPath = path.Substring(startPath.Length());
|
|
deltaPath = path.Substring(startPath.Length());
|
|
|
|
|
|
|
|
|
|
+ String filterExtension = filter.Substring(filter.Find('.'));
|
|
|
|
|
+ if (filterExtension.Contains('*'))
|
|
|
|
|
+ filterExtension.Clear();
|
|
|
|
|
+
|
|
|
#ifdef WIN32
|
|
#ifdef WIN32
|
|
|
- String pathAndFilter = GetNativePath(path + filter);
|
|
|
|
|
WIN32_FIND_DATAW info;
|
|
WIN32_FIND_DATAW info;
|
|
|
- HANDLE handle = FindFirstFileW(WString(pathAndFilter).CString(), &info);
|
|
|
|
|
|
|
+ HANDLE handle = FindFirstFileW(WString(path + "*").CString(), &info);
|
|
|
if (handle != INVALID_HANDLE_VALUE)
|
|
if (handle != INVALID_HANDLE_VALUE)
|
|
|
{
|
|
{
|
|
|
do
|
|
do
|
|
@@ -522,7 +525,10 @@ void FileSystem::ScanDirInternal(Vector<String>& result, String path, const Stri
|
|
|
ScanDirInternal(result, path + fileName, startPath, filter, flags, recursive);
|
|
ScanDirInternal(result, path + fileName, startPath, filter, flags, recursive);
|
|
|
}
|
|
}
|
|
|
else if (flags & SCAN_FILES)
|
|
else if (flags & SCAN_FILES)
|
|
|
- result.Push(deltaPath + fileName);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ if (filterExtension.Empty() || fileName.EndsWith(filterExtension))
|
|
|
|
|
+ result.Push(deltaPath + fileName);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
while (FindNextFileW(handle, &info));
|
|
while (FindNextFileW(handle, &info));
|
|
@@ -530,9 +536,6 @@ void FileSystem::ScanDirInternal(Vector<String>& result, String path, const Stri
|
|
|
FindClose(handle);
|
|
FindClose(handle);
|
|
|
}
|
|
}
|
|
|
#else
|
|
#else
|
|
|
- String filterExtension = filter.Substring(filter.Find('.'));
|
|
|
|
|
- if (filterExtension.Contains('*'))
|
|
|
|
|
- filterExtension.Clear();
|
|
|
|
|
DIR *dir;
|
|
DIR *dir;
|
|
|
struct dirent *de;
|
|
struct dirent *de;
|
|
|
struct stat st;
|
|
struct stat st;
|