conserver.cf: devicesubst add 'b' for baud rate

Add a 'b' subst format to get baud rate numbers as well to build
up device names and the others.
This commit is contained in:
Bjoern A. Zeeb 2021-07-16 15:24:44 +00:00
parent 8b3dfdb14f
commit 42e0b46e78
2 changed files with 8 additions and 0 deletions

View File

@ -540,6 +540,10 @@ value
.PP .PP
Numeric Replacement Numeric Replacement
.TP .TP
.B b
.B baud
value
.TP
.B p .B p
config config
.B port .B port

View File

@ -997,6 +997,9 @@ SubstValue(char c, char **s, int *i)
} else if (c == 'P') { } else if (c == 'P') {
(*i) = pCE->netport; (*i) = pCE->netport;
retval = 1; retval = 1;
} else if (c == 'b') {
(*i) = pCE->baud->irate;
retval = 1;
} }
} }
@ -1009,6 +1012,7 @@ SubstToken(char c)
switch (c) { switch (c) {
case 'p': case 'p':
case 'P': case 'P':
case 'b':
substTokenCount[(unsigned)c]++; substTokenCount[(unsigned)c]++;
return ISNUMBER; return ISNUMBER;
case 'h': case 'h':