>From 652c93f7e1eab3adabd06125a9c32d88ce56a385 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 21 Jun 2026 12:18:51 +0000 Subject: [PATCH 2/2] wordexp: clear positional parameters added 'set --' so $@, $*, $#, $1, $2 are cleared (does not seem to be in the spec, but cleaner) wordexp("$*", p, 0) was "$*","2>/dev/stderr", now empty list. --- src/misc/wordexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c index f64f5171..0dfa77e6 100644 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -116,7 +116,7 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags) if (null == 2) fcntl(2, F_SETFD, 0); else dup2(null, 2); execl("/bin/sh", "sh", "-c", - "eval \"printf %s\\\\\\\\0 x $1\"", + "eval \"set --;printf %s\\\\\\\\0 x $1\"", "sh", s, (char *)0); _exit(1); } -- 2.52.0