From 7ae423490d93fccee7692e71dec3a8916246f38b Mon Sep 17 00:00:00 2001 From: Trent Huber Date: Sun, 14 Jun 2026 22:11:25 -0400 Subject: [PATCH] Bug fix for exec() --- src/builtins/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins/exec.c b/src/builtins/exec.c index f05b9f4..52831be 100644 --- a/src/builtins/exec.c +++ b/src/builtins/exec.c @@ -21,8 +21,8 @@ int exec(char **args, size_t numargs) { if (numargs < 2) return usage(args[0], "command [args ...]"); - clear(&c); - memcpy(c.tokens, args + 1, (c.numtokens = numargs - 1) * sizeof*args); + c = (struct context){.t = c.tokens, .numtokens = numargs - 1}; + memcpy(c.tokens, args + 1, c.numtokens * sizeof*args); strcpy(c.name, args[1]); if (!(c.builtin = getbuiltin(c.name)) && !(c.path = getpath(c.name))) return note("Unable to find `%s' command", c.name); -- 2.53.0