diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-11 16:43:35 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-11 16:43:35 +0100 |
commit | 2429308bac5751fb136515027f6762ba76a7eb3d (patch) | |
tree | f2b93028e4320cda6af3c14eaa5f26dc7095c24d | |
parent | e641e8b1a33394d63a72693640c12cb26df25d3d (diff) |
Open URis with spaces.
-rw-r--r-- | libs/pbd/openuri.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 5f4f1ab546..5e7e8f5a02 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -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()); |