From d5b2552b9582cf10a4fce1fde3584415246d4ef9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 6 Apr 2024 11:13:24 -0400 Subject: [PATCH] acme: clean up environment after exec Make up for the lack of a real rfork(RFENVG). --- src/cmd/acme/exec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index 1dd02288..766669c2 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -1532,6 +1532,11 @@ runproc(void *argvp) iseditcmd = (uintptr)argv[9]; free(argv); + unsetenv("acmeaddr"); + unsetenv("winid"); + unsetenv("%"); + unsetenv("samfile"); + t = s; while(*t==' ' || *t=='\n' || *t=='\t') t++; @@ -1728,6 +1733,10 @@ Hard: rcarg[2] = t; rcarg[3] = nil; ret = threadspawnd(sfd, rcarg[0], rcarg, dir); + unsetenv("acmeaddr"); + unsetenv("winid"); + unsetenv("%"); + unsetenv("samfile"); free(dir); if(ret >= 0){ if(cpid)