From 28e83b27a1932cb729fb14ff2ac829333f25ec9c Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 20 Jul 2020 02:19:11 +0200 Subject: [PATCH] Make sure / or C:\ doesn't get search by idFileSystemLocal::ListMods() That could happen if the searchpath was "" (like the default value of fs_cdpath ...). I don't think it could do any damage, but it's confusing (if "developer" CVar is enabled) and pointless. It caused lots of "Non-portable: path contains uppercase characters: .." Warnings, which now also become more readable by adding a newline. --- neo/framework/FileSystem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neo/framework/FileSystem.cpp b/neo/framework/FileSystem.cpp index c7e13437..bbe77f02 100644 --- a/neo/framework/FileSystem.cpp +++ b/neo/framework/FileSystem.cpp @@ -798,7 +798,7 @@ const char *idFileSystemLocal::BuildOSPath( const char *base, const char *game, if ( testPath.HasUpper() ) { - common->DPrintf( "Non-portable: path contains uppercase characters: %s", testPath.c_str() ); + common->DPrintf( "Non-portable: path contains uppercase characters: %s\n", testPath.c_str() ); // attempt a fixup on the fly if ( fs_caseSensitiveOS.GetBool() ) { @@ -1709,6 +1709,10 @@ idModList *idFileSystemLocal::ListMods( void ) { search[3] = fs_cdpath.GetString(); for ( isearch = 0; isearch < 4; isearch++ ) { + // skip empty cdpath or such, so we don't search C:\ or / -_- + if ( search[ isearch ][ 0 ] == '\0' ) { + continue; + } dirs.Clear(); pk4s.Clear();