Skip to content
Snippets Groups Projects
Commit 13fdd67b authored by rswindell's avatar rswindell
Browse files

uploadfile() will move the file from the temp directory if necessary.

parent b766b961
Branches
Tags
No related merge requests found
...@@ -45,10 +45,11 @@ ...@@ -45,10 +45,11 @@
/****************************************************************************/ /****************************************************************************/
bool sbbs_t::uploadfile(file_t *f) bool sbbs_t::uploadfile(file_t *f)
{ {
char path[256],str[256],fname[25]; char path[MAX_PATH+1];
char str[MAX_PATH+1],fname[25];
char ext[F_EXBSIZE+1]; char ext[F_EXBSIZE+1];
char desc[F_EXBSIZE+1]; char desc[F_EXBSIZE+1];
char tmp[128]; char tmp[MAX_PATH+1];
int file; int file;
uint i; uint i;
long length; long length;
...@@ -62,6 +63,9 @@ bool sbbs_t::uploadfile(file_t *f) ...@@ -62,6 +63,9 @@ bool sbbs_t::uploadfile(file_t *f)
sprintf(path,"%s%s",f->altpath>0 && f->altpath<=cfg.altpaths sprintf(path,"%s%s",f->altpath>0 && f->altpath<=cfg.altpaths
? cfg.altpath[f->altpath-1] ? cfg.altpath[f->altpath-1]
: cfg.dir[f->dir]->path,unpadfname(f->name,fname)); : cfg.dir[f->dir]->path,unpadfname(f->name,fname));
sprintf(tmp,"%s%s",cfg.temp_dir,fname);
if(!fexist(path) && fexist(tmp))
mv(tmp,path,0);
if(!fexist(path)) { if(!fexist(path)) {
bprintf(text[FileNotReceived],f->name); bprintf(text[FileNotReceived],f->name);
sprintf(str,"%s attempted to upload %s to %s %s (Not received)" sprintf(str,"%s attempted to upload %s to %s %s (Not received)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment