Skip to content
Snippets Groups Projects
Commit 79a302f4 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Some archives don't have DIZ in the root directory

(I'm looking at you, mist1221.zip)

... so first try to extract DIZ files from the root of the archive, then try again searching nested directories too. <sigh>
parent a3b440cc
No related branches found
No related tags found
No related merge requests found
...@@ -1027,10 +1027,11 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size ...@@ -1027,10 +1027,11 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size
return false; return false;
} }
for(int nested = 0; nested <= 1; nested++) {
if(extract_files_from_archive(archive if(extract_files_from_archive(archive
,/* outdir: */cfg->temp_dir ,/* outdir: */cfg->temp_dir
,/* allowed_filename_chars: */NULL /* any */ ,/* allowed_filename_chars: */NULL /* any */
,/* with_path: */true ,/* with_path: */!nested
,/* overwrite: */false ,/* overwrite: */false
,/* max_files: */strListCount(diz_fnames) ,/* max_files: */strListCount(diz_fnames)
,/* file_list: */diz_fnames ,/* file_list: */diz_fnames
...@@ -1040,8 +1041,10 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size ...@@ -1040,8 +1041,10 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size
if(fexistcase(path)) if(fexistcase(path))
return true; return true;
} }
if(nested)
return false; return false;
} }
}
char* fext = getfext(f->name); char* fext = getfext(f->name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment