Commit c1fe5a06 authored by Rob Swindell's avatar Rob Swindell 💬
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
Pipeline #2358 passed with stage
in 9 minutes and 12 seconds
...@@ -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]);
......
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