for(j = 0; j < g_numForbiddenDirs; ++j)
{
- const char *p = strrchr(directory, '/');
- p = (p ? (p+1) : directory);
+ char* dbuf = g_strdup(directory);
+ if(*dbuf && dbuf[strlen(dbuf)-1] == '/')
+ dbuf[strlen(dbuf)-1] = 0;
+ const char *p = strrchr(dbuf, '/');
+ p = (p ? (p+1) : dbuf);
if(matchpattern(p, g_strForbiddenDirs[j], TRUE))
+ {
+ g_free(dbuf);
break;
+ }
+ g_free(dbuf);
}
if(j < g_numForbiddenDirs)
{
if(name == 0)
break;
- for(j = 0; j < g_numForbiddenDirs; ++j)
- if(!string_compare_nocase_upper(name, g_strForbiddenDirs[j]))
- break;
+ for(j = 0; j < g_numForbiddenDirs; ++j)
+ {
+ const char *p = strrchr(name, '/');
+ p = (p ? (p+1) : name);
+ if(matchpattern(p, g_strForbiddenDirs[j], TRUE))
+ break;
+ }
if(j < g_numForbiddenDirs)
continue;
for(j = 0; j < g_numForbiddenDirs; ++j)
{
- const char *p = strrchr(path, '/');
- p = (p ? (p+1) : path);
+ char* dbuf = g_strdup(path);
+ if(*dbuf && dbuf[strlen(dbuf)-1] == '/')
+ dbuf[strlen(dbuf)-1] = 0;
+ const char *p = strrchr(dbuf, '/');
+ p = (p ? (p+1) : dbuf);
if(matchpattern(p, g_strForbiddenDirs[j], TRUE))
+ {
+ g_free(dbuf);
break;
+ }
+ g_free(dbuf);
}
if(j < g_numForbiddenDirs)
return;
break;
for(j = 0; j < g_numForbiddenDirs; ++j)
- if(!Q_stricmp(name, g_strForbiddenDirs[j]))
+ {
+ const char *p = strrchr(name, '/');
+ p = (p ? (p+1) : name);
+ if(matchpattern(p, g_strForbiddenDirs[j], TRUE))
break;
+ }
if(j < g_numForbiddenDirs)
continue;