From 408fc858e1b5104e614cadfaa599b1474add0593 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 25 May 2017 12:02:11 +0200 Subject: [PATCH] Support opening filenames with spaces in external editor in Windows, fixes #3883 --- rtgui/extprog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index bdbbb85b4..33424fac9 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -324,7 +324,7 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName) #if defined WIN32 const auto cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\""); - auto success = ShellExecute( NULL, "open", cmdLine.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); + auto success = ShellExecute( NULL, "open", cmdLine.c_str(), ('"' + fileName + '"').c_str(), NULL, SW_SHOWNORMAL ); return (uintptr_t)success > 32; #elif defined __APPLE__