From a3cdba5e574e71ac75b07c41ab42d87efb4b42fe Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 19 Apr 2008 23:36:10 +0000 Subject: Fixed save file listing not working with MSVC. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4392 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/files.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/files.cc') 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 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)) -- cgit v1.2.3-54-g00ecf