From 3b4ef42bd5682800dfda831416ba01a2cbe418ae Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 1 Jun 2021 11:02:34 +0200 Subject: [PATCH] Fixed compilation on MSYS2 --- src/window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index dc468fb..e80c66b 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1908,7 +1908,9 @@ bool Window::on_key_press_event(GdkEventKey *event) { auto path = view ? view->file_path : view_folder; if(command.path) { std::smatch sm; - if(!std::regex_match(path.string(), sm, *command.path) && !std::regex_match(filesystem::get_short_path(path).string(), sm, *command.path)) + std::string path_str = path.string(); // Workaround for MSYS2 (g++ 9.1.0) + std::string short_path_str = filesystem::get_short_path(path).string(); // Workaround for MSYS2 (g++ 9.1.0) + if(!std::regex_match(path_str, sm, *command.path) && !std::regex_match(short_path_str, sm, *command.path)) continue; }