Support opening filenames with spaces in external editor in Windows, fixes #3883

This commit is contained in:
Morgan Hardwood 2017-05-25 12:02:11 +02:00
parent e242afedd6
commit 408fc858e1

View File

@ -324,7 +324,7 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName)
#if defined WIN32 #if defined WIN32
const auto cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\""); 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; return (uintptr_t)success > 32;
#elif defined __APPLE__ #elif defined __APPLE__