diff --git a/src/sbbs3/filedat.c b/src/sbbs3/filedat.c index 91f1fcc109bcdff606433222152a03519a897f36..52f3f48cce37612dc46d88325a06f09128ddff60 100644 --- a/src/sbbs3/filedat.c +++ b/src/sbbs3/filedat.c @@ -1064,14 +1064,12 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size ,/* max_files: */strListCount(diz_fnames) ,/* file_list: */diz_fnames ,/* recurse: */nested - ,/* error: */NULL, 0) >= 0) { + ,/* error: */NULL, 0) > 0) { for(i = 0; diz_fnames[i] != NULL; i++) { safe_snprintf(path, maxlen, "%s%s", cfg->temp_dir, diz_fnames[i]); // no slash - if(fexistcase(path)) + if(fexistcase(path) && flength(path) > 0) return true; } - if(nested) - return false; } } @@ -1082,12 +1080,15 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size return false; fextr_t* fextr = cfg->fextr[i]; - char cmd[512]; + char files[512]; + char cmd[1024]; + strListCombine(diz_fnames, files, sizeof files, " "); + // system() might return non-zero and still succeed in extracting *one* of the DIZ files: + if(system(cmdstr(cfg, /* user: */NULL, fextr->cmd, archive, files, cmd, sizeof cmd)) != 0) + ; for(i = 0; diz_fnames[i] != NULL; i++) { safe_snprintf(path, maxlen, "%s%s", cfg->temp_dir, diz_fnames[i]); - if(system(cmdstr(cfg, /* user: */NULL, fextr->cmd, archive, diz_fnames[i], cmd, sizeof(cmd))) != 0) - continue; - if(fexistcase(path)) + if(fexistcase(path) && flength(path) > 0) return true; } return false;