Skip to content
Snippets Groups Projects
Commit 3b2a58d7 authored by rswindell's avatar rswindell
Browse files

Search for the file in the data dir first, before falling back to the CWD

(ctrl_dir).
Use the CPM-EOF printfile mode to stop printing files when encountering a
SAUCE record.
parent d28b74e4
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
require("text.js", 'TextSectionLstHdr');
require("nodedefs.js", 'NODE_RTXT');
require("cga_defs.js", 'LIGHTGRAY');
require("sbbsdefs.js", 'P_CPM_EOF');
if(!bbs.mods.cnflib)
bbs.mods.cnflib = load({}, "cnflib.js");
......@@ -29,9 +30,9 @@ function read_list(sec)
f.close();
var list = [];
for(var i = 0; i < lines.length; i += 2) {
var path = file_getcase(lines[i]);
var path = txtsec_data(sec) + "/" + lines[i];
if(!path)
path = txtsec_data(sec) + "/" + lines[i];
path = file_getcase(lines[i]);
list.push({ path: path, orig_path: lines[i], desc: lines[i + 1]});
}
return list;
......@@ -145,10 +146,10 @@ while(bbs.online) {
if(typeof(cmd) == "number") {
cmd--;
console.attributes = LIGHTGRAY;
console.printfile(list[cmd].path);
console.printfile(list[cmd].path, P_CPM_EOF);
log(LOG_INFO, "read text file: " + list[cmd].path);
console.pause();
}
}
}
}
\ No newline at end of file
}
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