13
0

Open URis with spaces.

This commit is contained in:
Robin Gareus 2016-02-11 16:43:35 +01:00
parent e641e8b1a3
commit 2429308bac

View File

@ -57,8 +57,14 @@ PBD::open_uri (const char* uri)
global_epa->restore ();
}
std::string s(uri);
while (s.find("\\") != std::string::npos)
s.replace(s.find("\\"), 1, "\\\\");
while (s.find("\"") != std::string::npos)
s.replace(s.find("\\"), 1, "\\\"");
std::string command = "xdg-open ";
command += uri;
command += '"' + s + '"';
command += " &";
(void) system (command.c_str());