From 88845750041260523fe35c4f8b4bca7f5890e45b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 24 Jun 2025 04:44:31 -0400 Subject: usr.bin: osh: Clear argv after script command Signed-off-by: Ian Moffett --- usr.bin/osh/osh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.bin/osh/osh.c b/usr.bin/osh/osh.c index 04705f7..aa8ef27 100644 --- a/usr.bin/osh/osh.c +++ b/usr.bin/osh/osh.c @@ -356,6 +356,9 @@ open_script(const char *pathname) buf[buf_i] = '\0'; argc = parse_args(buf, argv, sizeof(argv)); command_match(buf, argc, argv, true); + + argv[0] = NULL; + argv[1] = NULL; buf_i = 0; continue; } -- cgit v1.2.3