Commit 73517eee authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix error when moving files

e.g. file.cpp line 239 (removefile) removing "" access=-203 info=smb_freemsgdat reading allocation record at offset 1108

Also, if there is an error removing the original file from the filebase, don't proceed to move the actual file (and log a successful move).
parent 367e86af
......@@ -244,6 +244,7 @@ bool sbbs_t::removefile(smb_t* smb, file_t* f)
bool sbbs_t::movefile(smb_t* smb, file_t* f, int newdir)
file_t orgfile = *f;
if(findfile(&cfg, newdir, f->name, NULL)) {
bprintf(text[FileAlreadyThere], f->name);
return false;
......@@ -251,7 +252,8 @@ bool sbbs_t::movefile(smb_t* smb, file_t* f, int newdir)
if(!addfile(&cfg, newdir, f, f->extdesc, /* client: */NULL))
return false;
removefile(smb, f);
if(!removefile(smb, &orgfile))
return false;
char str[MAX_PATH+1];
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