From 382356627ae06e8b4a84d8ff474d7b4cd279b284 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 26 Jun 2017 11:44:23 +0200 Subject: [PATCH] FileSearch: Check isDirectory in the non-Windows code c5fa470 made the extension check discard directories, but only in the new code that currently only is used on Windows. Let's add an equivalent check in the old code so that the behavior is consistent across platforms. --- Source/Core/Common/FileSearch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index ffae68b718..0a8d0b369c 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -52,6 +52,8 @@ std::vector DoFileSearch(const std::vector& directorie return FileSearchWithTest(directories, recursive, [&](const File::FSTEntry& entry) { if (accept_all) return true; + if (entry.isDirectory) + return false; std::string name = entry.virtualName; std::transform(name.begin(), name.end(), name.begin(), ::tolower); return std::any_of(exts.begin(), exts.end(), [&](const std::string& ext) {