From a6b1a8844dcfdc86a6d3f0f8352afb798e2b79f3 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 21 Feb 2022 19:14:41 +0100 Subject: [PATCH] Made the emulator wildcard support work on Windows. --- es-app/src/FileData.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 65305089c..189b1925a 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1455,9 +1455,16 @@ const std::string FileData::findEmulatorPath(std::string& command) // Find the first matching file if a wildcard was used for the emulator entry. if (path.find('*') != std::string::npos) { +#if defined(_WIN64) + Utils::FileSystem::StringList files { + Utils::FileSystem::getMatchingFiles(Utils::String::replace(path, "\\", "/"))}; + if (files.size() > 0) + path = Utils::String::replace(files.front(), "/", "\\"); +#else Utils::FileSystem::StringList files {Utils::FileSystem::getMatchingFiles(path)}; if (files.size() > 0) path = files.front(); +#endif } if (Utils::FileSystem::isRegularFile(path) || Utils::FileSystem::isSymlink(path)) {