commit c31f55f534c112abd2319b8b0de79878b39b775d from: Omar Polo date: Sat Aug 07 21:12:47 2021 UTC don't consider an error if ... can't be expanded commit - ef33a69e821d4cd948c47dae32edc968e3d22a6f commit + c31f55f534c112abd2319b8b0de79878b39b775d blob - 4d9762f94fc09a0e83c6154c96089f4803043cec blob + 2dea90aca8c47690f4e37ac1c1dcdce3cf81d43e --- script.c +++ script.c @@ -334,8 +334,6 @@ getvar_raw(const char *sym, struct op **raw) } } - before_printing(); - fprintf(stderr, "no rest argument `...'\n"); return EVAL_ERR; } @@ -816,10 +814,13 @@ eval(struct op *op) switch (op->type) { case OP_REST: - if ((ret = getvar_raw("...", &t)) != EVAL_OK) - return ret; - if ((ret = eval(t)) != EVAL_OK) - return ret; + /* + * Try to load the rest argument. Note that it can be + * empty! + */ + if ((ret = getvar_raw("...", &t)) == EVAL_OK) + if ((ret = eval(t)) != EVAL_OK) + return ret; break; case OP_ASSIGN: