From adb8ec1da8c321b85a9eb837f2a1c2a83a73d544 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 2 Nov 2022 15:58:41 +0600 Subject: [PATCH] filesystem: try to normalize linux gamedll path for liblist.gam --- filesystem/filesystem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index 17f7f845..c9dea1a6 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -746,6 +746,24 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool else if( !Q_stricmp( token, "gamedll_linux" )) { pfile = COM_ParseFile( pfile, GameInfo->game_dll_linux, sizeof( GameInfo->game_dll_linux )); + + // try to normalize filename only for liblist.gam + // from hl_i?86.so to hl.so + if( !isGameInfo ) + { + char *p; + COM_StripExtension( GameInfo->game_dll_linux ); + + p = Q_strrchr( GameInfo->game_dll_linux, '_' ); + + if( p && Q_stricmpext( "_i?86", p )) + { + *p = 0; + } + + COM_DefaultExtension( GameInfo->game_dll_linux, "."OS_LIB_EXT ); + } + found_linux = true; } // valid for both