SCP: Fixed 'rest of line' argument substitution %*

This commit is contained in:
Mark Pizzolato 2013-11-05 10:35:37 -08:00
parent f5cfa392d7
commit b85af46402

4
scp.c
View file

@ -1793,8 +1793,7 @@ for (; *ip && (op < oend); ) {
} }
else else
if ((*ip == '%') && if ((*ip == '%') &&
(!isalnum(ip[1])) && (isalnum(ip[1]) || (ip[1] == '*'))) { /* sub? */
(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 */
@ -1823,6 +1822,7 @@ for (; *ip && (op < oend); ) {
} }
else else
break; break;
ip = ip + 2;
} }
else { /* environment variable */ else { /* environment variable */
ap = NULL; ap = NULL;