Commit 82018810 authored by Rob Swindell's avatar Rob Swindell

New @-code TEXT:<num> to display text.dat string #num

Also, don't truncate strings to accommodate screen width when the string contains a new-line character.
This is so ScottD (from irc.synchro.net) can use TEXT:556 @-code to print the Ctrl-K menu (text.dat string) via a command shell written in Baja.
parent 87778c43
Pipeline #355 passed with stage
in 19 minutes and 51 seconds
......@@ -208,7 +208,7 @@ int sbbs_t::show_atcode(const char *instr, JSObject* obj)
if(uppercase && align == none)
align = left;
if(truncated) {
if(truncated && strchr(cp, '\n') == NULL) {
if(column + disp_len > cols - 1) {
if(column >= cols - 1)
disp_len = 0;
......@@ -752,6 +752,13 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool
return nulstr;
}
if(strncmp(sp, "TEXT:", 5) == 0) {
i = atoi(sp + 5);
if(i >= 1 && i <= TOTAL_TEXT)
return text[i - 1];
return nulstr;
}
/* NOSTOP */
/* STOP */
......
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