From 71a9a5efa6c2c9f2913cd6664519779dc2ac5414 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 4 Feb 2018 20:34:05 -0600 Subject: [PATCH] Make FS_InvalidGameDir() consider subdirectories invalid fs_game shouldn't be a subdirectory and it simplifies the code. --- code/qcommon/files.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 71613cd8..16869afc 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -3072,13 +3072,12 @@ qboolean FS_CheckDirTraversal(const char *checkdir) FS_InvalidGameDir return true if path is a reference to current directory or directory traversal +or a sub-directory ================ */ qboolean FS_InvalidGameDir( const char *gamedir ) { if ( !strcmp( gamedir, "." ) || !strcmp( gamedir, ".." ) - || !strcmp( gamedir, "/" ) || !strcmp( gamedir, "\\" ) - || strstr( gamedir, "/.." ) || strstr( gamedir, "\\.." ) - || FS_CheckDirTraversal( gamedir ) ) { + || strchr( gamedir, '/' ) || strchr( gamedir, '\\' ) ) { return qtrue; }