diff options
-rw-r--r-- | common/hush.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/hush.c b/common/hush.c index 602f8f1be1..b5e111a019 100644 --- a/common/hush.c +++ b/common/hush.c @@ -335,6 +335,19 @@ static int b_addchr(o_string *o, int ch) return 0; } +static int b_addstr(o_string *o, const char *str) +{ + int ret; + + while (*str) { + ret = b_addchr(o, *str++); + if (ret) + return ret; + } + + return 0; +} + static void b_reset(o_string *o) { o->length = 0; @@ -1407,6 +1420,14 @@ static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *i } b_addchr(dest, SPECIAL_VAR_SYMBOL); break; + case '*': + for (i = 1; i < ctx->global_argc; i++) { + b_addstr(dest, ctx->global_argv[i]); + b_addchr(dest, ' '); + } + + advance = 1; + break; default: b_addchr(dest, '$'); } |