typedef struct
{
+ char* unzFilePath;
char* name;
unzFile zipfile;
unz_file_pos zippos;
char g_strForbiddenDirs[VFS_MAXDIRS][PATH_MAX + 1];
int g_numForbiddenDirs = 0;
static gboolean g_bUsePak = TRUE;
+char g_strLoadedFileLocation[1024];
// =============================================================================
// Static functions
}
unzGoToFirstFile( uf );
+ char* unzFilePath = strdup( filename );
+
for ( i = 0; i < gi.number_entry; i++ )
{
char filename_inzip[NAME_MAX];
file->name = strdup( filename_lower );
file->size = file_info.uncompressed_size;
file->zipfile = uf;
+ file->unzFilePath = unzFilePath;
file->zippos = pos;
if ( ( i + 1 ) < gi.number_entry ) {
while ( g_pakFiles )
{
VFS_PAKFILE* file = (VFS_PAKFILE*)g_pakFiles->data;
+ free( file->unzFilePath );
free( file->name );
free( file );
g_pakFiles = g_slist_remove( g_pakFiles, file );
// filename is a full path
if ( index == -1 ) {
+ strcpy( g_strLoadedFileLocation, filename );
long len;
FILE *f;
strcat( tmp, filename );
if ( access( tmp, R_OK ) == 0 ) {
if ( count == index ) {
+ strcpy( g_strLoadedFileLocation, tmp );
+
long len;
FILE *f;
}
if ( count == index ) {
+ strcpy( g_strLoadedFileLocation, file->unzFilePath );
+ strcat( g_strLoadedFileLocation, " :: " );
+ strcat( g_strLoadedFileLocation, filename );
+
if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) {
return -1;