Commit 15142150 authored by rswindell's avatar rswindell
Browse files

Bugfix: movefile() would use the database's version of the filename

(the Micros~1 shortened version) when moving to a new directory.
As reported by Coolmax.
parent 60a62b28
......@@ -536,12 +536,13 @@ bool sbbs_t::removefcdt(file_t* f)
/****************************************************************************/
bool sbbs_t::movefile(file_t* f, int newdir)
{
char str[256],path[256],fname[128],ext[1024];
char str[MAX_PATH+1],path[MAX_PATH+1],fname[128],ext[1024];
int olddir=f->dir;
if(findfile(&cfg,newdir,f->name)) {
bprintf(text[FileAlreadyThere],f->name);
return(false); }
return(false);
}
getextdesc(&cfg,olddir,f->datoffset,ext);
if(cfg.dir[olddir]->misc&DIR_MOVENEW)
f->dateuled=time(NULL);
......@@ -558,8 +559,10 @@ bool sbbs_t::movefile(file_t* f, int newdir)
if(!f->altpath) { /* move actual file */
sprintf(str,"%s%s",cfg.dir[olddir]->path,fname);
if(fexistcase(str)) {
sprintf(path,"%s%s",cfg.dir[f->dir]->path,fname);
mv(str,path,0); } }
sprintf(path,"%s%s",cfg.dir[f->dir]->path,getfname(str));
mv(str,path,0);
}
}
if(f->misc&FM_EXTDESC)
putextdesc(&cfg,f->dir,f->datoffset,ext);
return(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment