aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-10 07:16:50 -0400
committerJack Lloyd <[email protected]>2017-09-10 07:16:50 -0400
commit359732815e61fe61cfc1f34698254e44137120e7 (patch)
tree6f47f59cbdffacff05283391c168f4318899f006 /src
parent2c869433aad96fab0e7640a2ac7397653b3bdefa (diff)
Make it actually work
Weirdly Wine at least does not set FILE_ATTRIBUTE_NORMAL on the files, instead sets FILE_ATTRIBUTE_ARCHIVE. ?? I have no idea what that's about.
Diffstat (limited to 'src')
-rw-r--r--src/lib/utils/filesystem.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/utils/filesystem.cpp b/src/lib/utils/filesystem.cpp
index 8c899dc9b..fd4aee1f0 100644
--- a/src/lib/utils/filesystem.cpp
+++ b/src/lib/utils/filesystem.cpp
@@ -127,7 +127,7 @@ std::vector<std::string> impl_win32(const std::string& dir_path)
dir_list.pop_front();
WIN32_FIND_DATA find_data;
- HANDLE dir = ::FindFirstFile(cur_path.c_str(), &find_data);
+ HANDLE dir = ::FindFirstFile((cur_path + "/*").c_str(), &find_data);
if(dir != INVALID_HANDLE_VALUE)
{
@@ -139,9 +139,13 @@ std::vector<std::string> impl_win32(const std::string& dir_path)
const std::string full_path = cur_path + "/" + filename;
if(find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
dir_list.push_back(full_path);
- else if(find_data.dwFileAttributes & FILE_ATTRIBUTE_NORMAL)
+ }
+ else
+ {
out.push_back(full_path);
+ }
}
while(::FindNextFile(dir, &find_data));
}