Commits (3)
...@@ -1027,20 +1027,23 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size ...@@ -1027,20 +1027,23 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size
return false; return false;
} }
if(extract_files_from_archive(archive for(int nested = 0; nested <= 1; nested++) {
,/* outdir: */cfg->temp_dir if(extract_files_from_archive(archive
,/* allowed_filename_chars: */NULL /* any */ ,/* outdir: */cfg->temp_dir
,/* with_path: */true ,/* allowed_filename_chars: */NULL /* any */
,/* overwrite: */false ,/* with_path: */!nested
,/* max_files: */strListCount(diz_fnames) ,/* overwrite: */false
,/* file_list: */diz_fnames ,/* max_files: */strListCount(diz_fnames)
,/* error: */NULL, 0) >= 0) { ,/* file_list: */diz_fnames
for(i = 0; diz_fnames[i] != NULL; i++) { ,/* error: */NULL, 0) >= 0) {
safe_snprintf(path, maxlen, "%s%s", cfg->temp_dir, diz_fnames[i]); // no slash for(i = 0; diz_fnames[i] != NULL; i++) {
if(fexistcase(path)) safe_snprintf(path, maxlen, "%s%s", cfg->temp_dir, diz_fnames[i]); // no slash
return true; if(fexistcase(path))
return true;
}
if(nested)
return false;
} }
return false;
} }
char* fext = getfext(f->name); char* fext = getfext(f->name);
......
...@@ -66,7 +66,7 @@ FILE* fopen_dstats(scfg_t* cfg, uint node, BOOL for_write) ...@@ -66,7 +66,7 @@ FILE* fopen_dstats(scfg_t* cfg, uint node, BOOL for_write)
char path[MAX_PATH+1]; char path[MAX_PATH+1];
dstats_fname(cfg, node, path, sizeof(path)); dstats_fname(cfg, node, path, sizeof(path));
return iniOpenFile(path, for_write); return fnopen(NULL, path, for_write ? O_CREAT|O_RDWR : O_RDONLY);
} }
/****************************************************************************/ /****************************************************************************/
...@@ -83,7 +83,7 @@ FILE* fopen_cstats(scfg_t* cfg, uint node, BOOL for_write) ...@@ -83,7 +83,7 @@ FILE* fopen_cstats(scfg_t* cfg, uint node, BOOL for_write)
/****************************************************************************/ /****************************************************************************/
BOOL fclose_dstats(FILE* fp) BOOL fclose_dstats(FILE* fp)
{ {
return iniCloseFile(fp); return fclose(fp);
} }
/****************************************************************************/ /****************************************************************************/
......
...@@ -297,7 +297,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl ...@@ -297,7 +297,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
strlwr(tmp); strlwr(tmp);
SAFEPRINTF2(str,"%s%s",dropdir,tmp); SAFEPRINTF2(str,"%s%s",dropdir,tmp);
(void)removecase(str); (void)removecase(str);
if((fp=fnopen(NULL, str, O_WRONLY|O_CREAT|O_TRUNC)) == NULL) { if((fp=fnopen(NULL, str, O_WRONLY|O_CREAT|O_TRUNC|O_TEXT)) == NULL) {
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT); errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
return; return;
} }
......