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

Add command-line specifier %- for user's chat handle/call-sign

That's percent minus, to go with percent plus (user's real name).

The string is auto-quoted if it contains a space.

For Keyop's use with rlogin.js, maybe.
parent 78dc9470
No related branches found
No related tags found
No related merge requests found
Pipeline #4975 passed
......@@ -1343,6 +1343,10 @@ char* cmdstr(scfg_t* cfg, user_t* user, const char* instr, const char* fpath
if(user != NULL)
strncat(cmd, quoted_string(user->name, str, sizeof(str)), avail);
break;
case '-': /* Chat handle */
if(user != NULL)
strncat(cmd, quoted_string(user->handle, str, sizeof(str)), avail);
break;
default: /* unknown specification */
if(IS_DIGIT(instr[i]) && user!=NULL) {
sprintf(str,"%0*d",instr[i]&0xf,user->number);
......
......@@ -2145,14 +2145,21 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
case '+': /* Real name */
strncat(cmd, quoted_string(useron.name, str, sizeof(str)), avail);
break;
case '-': /* Chat handle */
strncat(cmd, quoted_string(useron.handle, str, sizeof(str)), avail);
break;
default: /* unknown specification */
if(IS_DIGIT(instr[i])) {
snprintf(str, sizeof str, "%0*d",instr[i]&0xf,useron.number);
strncat(cmd,str, avail); }
break; }
j=strlen(cmd); }
strncat(cmd,str, avail);
}
break;
}
j=strlen(cmd);
}
else
cmd[j++]=instr[i]; }
cmd[j++]=instr[i];
}
cmd[j]=0;
return(cmd);
......
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