- if(!Q_stricmp(path, g_strForbiddenDirs[j])
- || (strlen(path) > strlen(g_strForbiddenDirs[j]) && path[strlen(path) - strlen(g_strForbiddenDirs[j]) - 1] == '/' && !Q_stricmp(path + strlen(path) - strlen(g_strForbiddenDirs[j]), g_strForbiddenDirs[j])))
+ const char *p = strrchr(path, '/');
+ p = (p ? (p+1) : path);
+ if(matchpattern(p, g_strForbiddenDirs[j], TRUE))