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

Add command-line specifier for user's real name (auto-quoted)

%+ will now expand to the current user's real name, automatically enclosed in quotes if it contains any spaces.
parent e10b39d1
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2465 passed
......@@ -1218,6 +1218,10 @@ char* cmdstr(scfg_t* cfg, user_t* user, const char* instr, const char* fpath
case '^': /* Architecture */
strncat(cmd, ARCHITECTURE_DESC, avail);
break;
case '+': /* Real name */
if(user != NULL)
strncat(cmd, quoted_string(user->name, str, sizeof(str)), avail);
break;
default: /* unknown specification */
if(IS_DIGIT(instr[i]) && user!=NULL) {
sprintf(str,"%0*d",instr[i]&0xf,user->number);
......
......@@ -2097,6 +2097,9 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
case '^': /* Architecture */
strncat(cmd, ARCHITECTURE_DESC, avail);
break;
case '+': /* Real name */
strncat(cmd, quoted_string(useron.name, str, sizeof(str)), avail);
break;
default: /* unknown specification */
if(IS_DIGIT(instr[i])) {
sprintf(str,"%0*d",instr[i]&0xf,useron.number);
......
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