From d203aa7bab5e9f7bcc7cfd6d512c327736083aa0 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 2 Dec 2017 10:59:05 +0000 Subject: [PATCH] Fix loading Mac VST bundles with path terminating in slash --- source/backend/plugin/CarlaPluginVST2.cpp | 5 ++++- source/discovery/carla-discovery.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/backend/plugin/CarlaPluginVST2.cpp b/source/backend/plugin/CarlaPluginVST2.cpp index 5df1f42a8..3054b410d 100644 --- a/source/backend/plugin/CarlaPluginVST2.cpp +++ b/source/backend/plugin/CarlaPluginVST2.cpp @@ -2099,7 +2099,10 @@ public: VST_Function vstFn; #ifdef CARLA_OS_MAC - if (CarlaString(filename).toLower().endsWith(".vst")) + CarlaString filenameCheck(filename); + filenameCheck.toLower(); + + if (filenameCheck.endsWith(".vst") || filenameCheck.endsWith(".vst/")) { // FIXME assert returns, set engine error const CFURLRef urlRef = CFURLCreateFromFileSystemRepresentation(0, (const UInt8*)filename, (CFIndex)strlen(filename), true); diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index cee77b7e1..c801b0369 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -1650,7 +1650,7 @@ int main(int argc, char* argv[]) return 0; } #ifdef CARLA_OS_MAC - if (type == PLUGIN_VST2 && filenameCheck.endsWith(".vst")) + if (type == PLUGIN_VST2 && (filenameCheck.endsWith(".vst") || filenameCheck.endsWith(".vst/"))) openLib = false; #endif }