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:
parent
32b8f06362
commit
f5cfa392d7
1 changed files with 3 additions and 1 deletions
4
scp.c
4
scp.c
|
@ -1792,7 +1792,9 @@ for (; *ip && (op < oend); ) {
|
||||||
*op++ = *ip++; /* copy escaped char */
|
*op++ = *ip++; /* copy escaped char */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (*ip == '%') { /* sub? */
|
if ((*ip == '%') &&
|
||||||
|
(!isalnum(ip[1])) &&
|
||||||
|
(ip[1] != '\0')) { /* sub? */
|
||||||
if ((ip[1] >= '0') && (ip[1] <= ('9'))) { /* %n = sub */
|
if ((ip[1] >= '0') && (ip[1] <= ('9'))) { /* %n = sub */
|
||||||
ap = do_arg[ip[1] - '0'];
|
ap = do_arg[ip[1] - '0'];
|
||||||
for (i=0; i<ip[1] - '0'; ++i) /* make sure we're not past the list end */
|
for (i=0; i<ip[1] - '0'; ++i) /* make sure we're not past the list end */
|
||||||
|
|
Loading…
Add table
Reference in a new issue