From cfa765e4d633f2bf571fe6ae6bf87050ac054862 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 24 Feb 2020 13:21:44 +0100 Subject: [PATCH] Clean up file path creation --- src/plugin/bridge.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugin/bridge.cpp b/src/plugin/bridge.cpp index 7a855d9f..3869b511 100644 --- a/src/plugin/bridge.cpp +++ b/src/plugin/bridge.cpp @@ -144,8 +144,9 @@ float Bridge::get_parameter(AEffect* /*plugin*/, int32_t /*index*/ * @throw std::runtime_error If the Wine VST host could not be found. */ fs::path find_wine_vst_host() { - fs::path host_path = fs::canonical(boost::dll::this_line_location()); - host_path.remove_filename().append(yabridge_wine_host_name); + fs::path host_path = + fs::canonical(boost::dll::this_line_location()).remove_filename() / + yabridge_wine_host_name; if (fs::exists(host_path)) { return host_path; } @@ -207,10 +208,8 @@ fs::path generate_endpoint_name() { alphanumeric_characters + strlen(alphanumeric_characters) - 1, std::back_inserter(random_id), 8, rng); - candidate_endpoint = - fs::temp_directory_path() - .append("yabridge") - .append(plugin_name + "-" + random_id + ".sock"); + candidate_endpoint = fs::temp_directory_path() / "yabridge" / + (plugin_name + "-" + random_id + ".sock"); } while (fs::exists(candidate_endpoint)); // Ensure that the parent directory exists so the socket endpoint can be @@ -238,7 +237,7 @@ bp::environment set_wineprefix() { fs::path wineprefix_path = boost::dll::this_line_location().remove_filename(); while (wineprefix_path != "") { - if (fs::is_directory(fs::path(wineprefix_path).append("dosdevices"))) { + if (fs::is_directory(wineprefix_path / "dosdevices")) { env["WINEPREFIX"] = wineprefix_path.string(); break; }