SCP: Allow bare % not followed by a digit or a alpha character to be kept while substituting arguments and environment variables in simulator commands.

This commit is contained in:
Mark Pizzolato 2013-11-05 10:06:46 -08:00
parent 32b8f06362
commit f5cfa392d7

4
scp.c
View file

@ -1792,7 +1792,9 @@ for (; *ip && (op < oend); ) {
*op++ = *ip++; /* copy escaped char */
}
else
if (*ip == '%') { /* sub? */
if ((*ip == '%') &&
(!isalnum(ip[1])) &&
(ip[1] != '\0')) { /* sub? */
if ((ip[1] >= '0') && (ip[1] <= ('9'))) { /* %n = sub */
ap = do_arg[ip[1] - '0'];
for (i=0; i<ip[1] - '0'; ++i) /* make sure we're not past the list end */