Subject: make should unset $ENV
To: None <tech-toolchain@netbsd.org>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-toolchain
Date: 08/01/2003 00:35:18
Both our /bin/sh and ksh will use the file pointed to by $ENV as a
startup script (like csh's .cshrc).  It occurs to me that any build
that relies on $ENV being set and doing something is in serious
trouble.

The patch below unsets $ENV at the ealiest opportunity.

--sjg

Index: main.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/main.c,v
retrieving revision 1.90
diff -u -p -r1.90 main.c
--- main.c	2003/08/01 00:39:53	1.90
+++ main.c	2003/08/01 07:35:02
@@ -533,6 +533,12 @@ main(int argc, char **argv)
 		progname++;
 	else
 		progname = argv[0];
+
+	/*
+	 * Get rid of $ENV before we risk any shell commands.
+	 */
+	unsetenv("ENV");
+
 #ifdef RLIMIT_NOFILE
 	/*
 	 * get rid of resource limit on file descriptors