Skip to content
Snippets Groups Projects
Commit be0c953e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't attempt to remove files that have already been removed

This is the likely cause of Phil's reported errors when removing files:
access=-110 info=smb_removefile name not found

The only way I was able to reproduce these errors was to attempt to remove the same file multiple times in the same file listing. In other worse, use 'R', remove a file, then 'P'revious back to the first file and try to remove it again. Or to remove it a file from the batch flag prompt and then attempt to remove it again. <shrug>
parent 3d1e05e5
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -676,7 +676,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
if(filematch(bf[i]->name, str+c)) {
if(!(bf[i]->hdr.attr & MSG_DELETE) && filematch(bf[i]->name, str+c)) {
if(ch=='R') {
if(removefile(smb, bf[i])) {
if(remfile) {
......@@ -696,18 +696,20 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') {
file_t* f = bf[str[c]-'A'];
if(ch=='R') {
if(removefile(smb, f)) {
if(remfile) {
if(remove(getfilepath(&cfg, f, path)) != 0 && fexist(path))
errormsg(WHERE, ERR_REMOVE, path);
if(!(f->hdr.attr & MSG_DELETE)) {
if(ch=='R') {
if(removefile(smb, f)) {
if(remfile) {
if(remove(getfilepath(&cfg, f, path)) != 0 && fexist(path))
errormsg(WHERE, ERR_REMOVE, path);
}
if(remcdt)
removefcdt(f);
}
if(remcdt)
removefcdt(f);
}
else if(ch=='M')
movefile(smb, f, usrdir[ml][md]);
}
else if(ch=='M')
movefile(smb, f, usrdir[ml][md]);
}
}
return(2);
......@@ -769,6 +771,8 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
break;
}
m++;
if(f->hdr.attr & MSG_DELETE)
continue;
if(mode==FI_OLD && f->hdr.last_downloaded > ns_time)
continue;
if((mode==FI_OLDUL || mode==FI_OLD) && f->hdr.when_written.time > ns_time)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment