From 201617f03bda36832df3865240e837851f854eb9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 8 Dec 2022 01:50:28 +0100 Subject: [PATCH] Fix macOS URI open curl_easy_escape() escapes slashes, which fails with openURL on modern macOS. Also add missing call to curl_easy_cleanup(). --- libs/pbd/openuri.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 451f37cb35..780f46fb74 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -23,6 +23,7 @@ #endif #include + #include #include #include @@ -103,9 +104,12 @@ PBD::open_folder (const std::string& d) bool rv = false; if (curl) { char * e = curl_easy_escape (curl, d.c_str(), d.size()); - std::string url = "file:///" + std::string(e); + std::string p (e); + boost::replace_all (p, "%2F", "/"); + std::string url = "file://" + p; rv = PBD::open_uri (url); curl_free (e); + curl_easy_cleanup(curl); } return rv; #else