Skip to content
Snippets Groups Projects
Commit bf3d51dd authored by Kayz's avatar Kayz
Browse files

Update text_sec.js - don't ask for description if file does not exist, don't...

Update text_sec.js - don't ask for description if file does not exist, don't permanently change file path if file doesn't exist (let user correct the path on next add attempt)
parent 9896598c
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!101Fix text_sec issues on add file
Pipeline #1290 passed
......@@ -129,10 +129,20 @@ while(bbs.online) {
console.print(format(bbs.text(AddTextFilePath)
,system.data_dir, usrsec[cursec].code.toLowerCase()));
var path = console.getstr(path, 128, K_EDIT|K_LINE|K_TRIM);
var path2;
if(!path || console.aborted)
break;
if(!file_exists(path))
path = backslash(txtsec_data(usrsec[cursec])) + path;
if(!file_exists(path)) {
path2 = backslash(txtsec_data(usrsec[cursec])) + path;
if (!file_exists(path2)) {
console.print(bbs.text(FileNotFound));
break;
} else {
// only change the path if the file was found, otherwise
// leave it alone so they can correct it
path = path2;
}
}
console.printfile(path);
console.crlf();
console.print(bbs.text(AddTextFileDesc));
......
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