From: Thomas Debesse Date: Mon, 25 May 2020 19:22:53 +0000 (+0200) Subject: Merge commit 'bf6dd1f2d186c799adf11f1e744a1ff57aa8d335' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=84881a66140ad93d0b6cd4d55efbbb459bd91f48;p=xonotic%2Fnetradiant.git Merge commit 'bf6dd1f2d186c799adf11f1e744a1ff57aa8d335' into garux-merge --- 84881a66140ad93d0b6cd4d55efbbb459bd91f48 diff --cc tools/quake3/common/vfs.c index e8648e81,2cafd3f0..362bffe1 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@@ -59,9 -55,10 +59,10 @@@ typedef struct { + char* unzFilePath; char* name; - unz_s zipinfo; unzFile zipfile; + unz_file_pos zippos; guint32 size; } VFS_PAKFILE; @@@ -145,13 -139,13 +149,14 @@@ static void vfsInitPakFile( const char g_pakFiles = g_slist_append( g_pakFiles, file ); vfsFixDOSName( filename_inzip ); - g_strdown( filename_inzip ); + //-1 null terminated string + filename_lower = g_ascii_strdown( filename_inzip, -1 ); - file->name = strdup( filename_inzip ); + file->name = strdup( filename_lower ); file->size = file_info.uncompressed_size; file->zipfile = uf; + file->unzFilePath = unzFilePath; - memcpy( &file->zipinfo, uf, sizeof( unz_s ) ); + file->zippos = pos; if ( ( i + 1 ) < gi.number_entry ) { err = unzGoToNextFile( uf ); @@@ -465,10 -460,12 +474,14 @@@ int vfsLoadFile( const char *filename, } if ( count == index ) { + strcpy( g_strLoadedFileLocation, file->unzFilePath ); + strcat( g_strLoadedFileLocation, " :: " ); + strcat( g_strLoadedFileLocation, filename ); + - memcpy( file->zipfile, &file->zipinfo, sizeof( unz_s ) ); + if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) { + return -1; + } if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) { return -1; }