summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/files.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index d29964a2b7..c1ffa33500 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -239,7 +239,11 @@ std::vector<std::string> get_dir_files(const std::string &dirname)
#ifdef _MSC_VER
WIN32_FIND_DATA lData;
- HANDLE hFind = FindFirstFile(dirname.c_str(), &lData);
+ std::string dir = dirname;
+ if (!dir.empty() && dir[dir.length() - 1] != FILE_SEPARATOR)
+ dir += FILE_SEPARATOR;
+ dir += "*";
+ HANDLE hFind = FindFirstFile(dir.c_str(), &lData);
if (hFind != INVALID_HANDLE_VALUE)
{
if (_is_good_filename(lData.cFileName))