Merge pull request #68 from bzfbd/bz_subst

conserver.cf: devicesubst add 'b' for baud rate
This commit is contained in:
Bryan Stansell 2021-07-17 10:49:38 -07:00 committed by GitHub
commit 0ed802ea6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -987,6 +987,13 @@ SubstValue(char c, char **s, int *i)
(*s) = pCE->replstring;
}
retval = 1;
} else if (c == 'b') {
if (pCE->baud == NULL || pCE->baud->acrate == (char *)0) {
(*s) = empty;
} else {
(*s) = pCE->baud->acrate;
}
retval = 1;
}
}
@ -1013,6 +1020,7 @@ SubstToken(char c)
return ISNUMBER;
case 'h':
case 'c':
case 'b':
case 'r':
substTokenCount[(unsigned)c]++;
return ISSTRING;