Skip to content
Snippets Groups Projects
Commit 29a8cb73 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 8034ec78
No related branches found
No related tags found
No related merge requests found
...@@ -676,7 +676,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total ...@@ -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=strchr(str+c,',');
if(p) *p=0; if(p) *p=0;
for(i=0;i<total;i++) { 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(ch=='R') {
if(removefile(smb, bf[i])) { if(removefile(smb, bf[i])) {
if(remfile) { if(remfile) {
...@@ -696,18 +696,20 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total ...@@ -696,18 +696,20 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
c+=strlen(str+c); c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') { else if(str[c]<'A'+(char)total && str[c]>='A') {
file_t* f = bf[str[c]-'A']; file_t* f = bf[str[c]-'A'];
if(ch=='R') { if(!(f->hdr.attr & MSG_DELETE)) {
if(removefile(smb, f)) { if(ch=='R') {
if(remfile) { if(removefile(smb, f)) {
if(remove(getfilepath(&cfg, f, path)) != 0 && fexist(path)) if(remfile) {
errormsg(WHERE, ERR_REMOVE, path); 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); return(2);
...@@ -769,6 +771,8 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode) ...@@ -769,6 +771,8 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
break; break;
} }
m++; m++;
if(f->hdr.attr & MSG_DELETE)
continue;
if(mode==FI_OLD && f->hdr.last_downloaded > ns_time) if(mode==FI_OLD && f->hdr.last_downloaded > ns_time)
continue; continue;
if((mode==FI_OLDUL || mode==FI_OLD) && f->hdr.when_written.time > ns_time) 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