Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

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

Fix error when moving files

e.g. file.cpp line 239 (removefile) removing "filename.zip" 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;
bprintf(text[MovedFile],f->name
,cfg.lib[cfg.dir[newdir]->lib]->sname,cfg.dir[newdir]->sname);
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