]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/vfspk3/vfs.cpp
forbidden dirs: allow wildcard patterns
[xonotic/netradiant.git] / plugins / vfspk3 / vfs.cpp
index b47942ba9149e2394fdaafc35cc2783b47c26902..8890edd27f5ef639f29dfefb9a3a5636f757ee16 100644 (file)
@@ -315,8 +315,9 @@ void InitDirectory(const char* directory, ArchiveModules& archiveModules)
 
   for(j = 0; j < g_numForbiddenDirs; ++j)
   {
-    if(!string_compare_nocase_upper(directory, g_strForbiddenDirs[j])
-    || (string_length(directory) > string_length(g_strForbiddenDirs[j]) && directory[string_length(directory) - string_length(g_strForbiddenDirs[j]) - 1] == '/' && !string_compare_nocase_upper(directory + string_length(directory) - string_length(g_strForbiddenDirs[j]), g_strForbiddenDirs[j])))
+    const char *p = strrchr(directory, '/');
+    p = (p ? (p+1) : path);
+    if(matchpattern(p, g_strForbiddenDirs[j], TRUE))
       break;
   }
   if(j < g_numForbiddenDirs)