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

Use K_TRIM getstr() mode when prompting for filenames

Don't need no stinking pre/appended white-space in our filenames!
parent 6438887a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2358 passed
...@@ -281,14 +281,14 @@ int sbbs_t::exec_function(csi_t *csi) ...@@ -281,14 +281,14 @@ int sbbs_t::exec_function(csi_t *csi)
if(!chksyspass()) if(!chksyspass())
return(0); return(0);
bputs(text[Filename]); bputs(text[Filename]);
if(getstr(str,60,0)) if(getstr(str,60,K_TRIM))
printfile(str,0); printfile(str,0);
return(0); return(0);
case CS_EDIT_TEXT_FILE: /* Edit ASCII/Ctrl-A file */ case CS_EDIT_TEXT_FILE: /* Edit ASCII/Ctrl-A file */
if(!chksyspass()) if(!chksyspass())
return(0); return(0);
bputs(text[Filename]); bputs(text[Filename]);
if(getstr(str,60,0)) if(getstr(str,60,K_TRIM))
editfile(str); editfile(str);
return(0); return(0);
case CS_GURU_LOG: case CS_GURU_LOG:
......
...@@ -276,7 +276,7 @@ bool sbbs_t::upload(uint dirnum) ...@@ -276,7 +276,7 @@ bool sbbs_t::upload(uint dirnum)
f.dir=curdirnum=dirnum; f.dir=curdirnum=dirnum;
bputs(text[Filename]); bputs(text[Filename]);
if(getstr(fname, sizeof(fname) - 1, 0) < 1 || !checkfname(fname)) { if(getstr(fname, sizeof(fname) - 1, K_TRIM) < 1 || !checkfname(fname)) {
if(fname[0]) if(fname[0])
bprintf(text[BadFilename], fname); bprintf(text[BadFilename], fname);
return(false); return(false);
...@@ -336,6 +336,10 @@ bool sbbs_t::upload(uint dirnum) ...@@ -336,6 +336,10 @@ bool sbbs_t::upload(uint dirnum)
if(!dir_op(dirnum)) if(!dir_op(dirnum))
return(false); /* File is in database for another dir */ return(false); /* File is in database for another dir */
} }
if(msgabort(true)) {
bputs(text[SearchedForDupes]);
return false;
}
} }
} }
bputs(text[SearchedForDupes]); bputs(text[SearchedForDupes]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment