case insensitive ".dll" for VST plugins - fixes #6285
authorRobin Gareus <robin@gareus.org>
Sun, 26 Apr 2015 19:26:12 +0000 (21:26 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 26 Apr 2015 19:26:12 +0000 (21:26 +0200)
TODO: check portability of strcasestr()

libs/ardour/plugin_manager.cc
libs/ardour/vst_info_file.cc
libs/fst/scanner.cc

index e88541317c586ff42fc7c3dce307878d461688d4..37eb61ef3b88ea4d787517f057205fba85c8a707 100644 (file)
@@ -686,8 +686,7 @@ PluginManager::windows_vst_refresh (bool cache_only)
 static bool windows_vst_filter (const string& str, void * /*arg*/)
 {
        /* Not a dotfile, has a prefix before a period, suffix is "dll" */
-
-       return str[0] != '.' && (str.length() > 4 && str.find (".dll") == (str.length() - 4));
+       return str[0] != '.' && str.length() > 4 && strings_equal_ignore_case (".dll", str.substr(str.length() - 4));
 }
 
 int
index 2d68421103d0d14930f8ff9d5925ba333d39540f..2b79f2bc774bfc707f26398efdaefcc914d85d63 100644 (file)
@@ -351,7 +351,7 @@ vstfx_write_info_file (FILE* fp, vector<VSTInfo *> *infos)
 static bool
 vstfx_blacklist_stat (const char *dllpath, int personal)
 {
-       if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
+       if (strstr (dllpath, ".so" ) == 0 && strcasestr(dllpath, ".dll") == 0) {
                return true;
        }
        string const path = vstfx_blacklist_path (dllpath, personal);
@@ -435,7 +435,7 @@ vstfx_remove_infofile (const char *dllpath)
 static char *
 vstfx_infofile_stat (const char *dllpath, struct stat* statbuf, int personal)
 {
-       if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
+       if (strstr (dllpath, ".so" ) == 0 && strcasestr(dllpath, ".dll") == 0) {
                return 0;
        }
 
@@ -494,7 +494,7 @@ vstfx_infofile_for_read (const char* dllpath)
 static FILE *
 vstfx_infofile_create (const char* dllpath, int personal)
 {
-       if (strstr (dllpath, ".so" ) == 0 && strstr(dllpath, ".dll") == 0) {
+       if (strstr (dllpath, ".so" ) == 0 && strcasestr(dllpath, ".dll") == 0) {
                return 0;
        }
 
index c7cbd897dbfe22dcbf4d621e325bf3e91720c142..aac1eb5d2ac72ba5491c11c82bc2ea1d73835936 100644 (file)
@@ -75,7 +75,7 @@ int main (int argc, char **argv) {
        char *dllpath = NULL;
        if (argc == 3 && !strcmp("-f", argv[1])) {
                dllpath = argv[2];
-               if (strstr (dllpath, ".so" ) || strstr(dllpath, ".dll")) {
+               if (strstr (dllpath, ".so" ) || strcasestr(dllpath, ".dll")) {
                        vstfx_remove_infofile(dllpath);
                        vstfx_un_blacklist(dllpath);
                }
@@ -105,7 +105,7 @@ int main (int argc, char **argv) {
 #endif
 
 #ifdef WINDOWS_VST_SUPPORT
-       else if (strstr (dllpath, ".dll")) {
+       else if (strcasestr (dllpath, ".dll")) {
                infos = vstfx_get_info_fst(dllpath);
        }
 #endif