diff options
author | Robin Gareus <robin@gareus.org> | 2015-04-27 18:23:51 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-27 18:23:51 +0200 |
commit | 5291400878597a0bd3b1a70578c9edcbf5be21fe (patch) | |
tree | 6c9c165dd037691fa7c3f842e496383d282c2c1c /libs/ardour/vst_info_file.cc | |
parent | 7c09182d753ee1cc7c6fc95b0093c7046ccebe78 (diff) |
case insensitive VST plugin file extension - fixes #6285
2nd attempt.
Diffstat (limited to 'libs/ardour/vst_info_file.cc')
-rw-r--r-- | libs/ardour/vst_info_file.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libs/ardour/vst_info_file.cc b/libs/ardour/vst_info_file.cc index 2d68421103..3b56876494 100644 --- a/libs/ardour/vst_info_file.cc +++ b/libs/ardour/vst_info_file.cc @@ -351,9 +351,15 @@ 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) { + const size_t slen = strlen (dllpath); + if ( + (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so")) + && + (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll")) + ) { return true; } + string const path = vstfx_blacklist_path (dllpath, personal); if (Glib::file_test (path, Glib::FileTest (Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR))) { @@ -435,7 +441,12 @@ 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) { + const size_t slen = strlen (dllpath); + if ( + (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so")) + && + (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll")) + ) { return 0; } @@ -494,8 +505,13 @@ 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) { - return 0; + const size_t slen = strlen (dllpath); + if ( + (slen <= 3 || g_ascii_strcasecmp (&dllpath[slen-3], ".so")) + && + (slen <= 4 || g_ascii_strcasecmp (&dllpath[slen-4], ".dll")) + ) { + return NULL; } string const path = vstfx_infofile_path (dllpath, personal); |