summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-11 16:43:35 +0100
committerRobin Gareus <robin@gareus.org>2016-02-11 16:43:35 +0100
commit2429308bac5751fb136515027f6762ba76a7eb3d (patch)
treef2b93028e4320cda6af3c14eaa5f26dc7095c24d /libs
parente641e8b1a33394d63a72693640c12cb26df25d3d (diff)
Open URis with spaces.
Diffstat (limited to 'libs')
-rw-r--r--libs/pbd/openuri.cc8
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());