X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fcommon%2Fvfs.c;h=ef2fad8a13e847a2c707ab4d7fb12d96478f9a76;hb=c75ae4296b59dbdc836355dcf8478bc097b32ebd;hp=86a749c754ca2cadc9a647f9c9fa3e2d52594209;hpb=4cd61dfa7d9363082c8161823634f497b82d8f98;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index 86a749c7..ef2fad8a 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -46,6 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "cmdlib.h" +#include "filematch.h" #include "mathlib.h" #include "inout.h" #include "vfs.h" @@ -160,8 +161,9 @@ void vfsInitDirectory (const char *path) for(j = 0; j < g_numForbiddenDirs; ++j) { - 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)) break; } if(j < g_numForbiddenDirs)