about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
authorTeubel György <tgyurci@gmail.com>2016-09-03 23:06:30 +0200
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2016-09-05 21:03:12 +0100
commitfde365ea8ba91a4e7daa27dfd63fdadb55a882f5 (patch)
tree2fcced596ce2e94c0e2ede4fb9bff5f16b6ed2f9 /Src/init.c
parent02bb3de2575aca2b0e823b96d8281c89a77eba42 (diff)
downloadzsh-fde365ea8ba91a4e7daa27dfd63fdadb55a882f5.tar.gz
zsh-fde365ea8ba91a4e7daa27dfd63fdadb55a882f5.tar.xz
zsh-fde365ea8ba91a4e7daa27dfd63fdadb55a882f5.zip
39167: Make $ENV handling more like POSIX
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/Src/init.c b/Src/init.c
index 20a07eb0a..3dea179b9 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -712,7 +712,7 @@ init_term(void)
     if (tgetent(termbuf, term) != TGETENT_SUCCESS)
 #endif
     {
-	if (isset(INTERACTIVE))
+	if (interact)
 	    zerr("can't find terminal definition for %s", term);
 	errflag &= ~ERRFLAG_ERROR;
 	termflags |= TERM_BAD;
@@ -1205,19 +1205,22 @@ run_init_scripts(void)
 	if (islogin)
 	    source("/etc/profile");
 	if (unset(PRIVILEGED)) {
-	    char *s = getsparam("ENV");
 	    if (islogin)
 		sourcehome(".profile");
-	    noerrs = 2;
-	    if (s) {
-		s = dupstring(s);
-		if (!parsestr(&s)) {
-		    singsub(&s);
-		    noerrs = 0;
-		    source(s);
+
+	    if (interact) {
+		noerrs = 2;
+		char *s = getsparam("ENV");
+		if (s) {
+		    s = dupstring(s);
+		    if (!parsestr(&s)) {
+			singsub(&s);
+			noerrs = 0;
+			source(s);
+		    }
 		}
+		noerrs = 0;
 	    }
-	    noerrs = 0;
 	} else
 	    source("/etc/suid_profile");
     } else {
@@ -1227,7 +1230,7 @@ run_init_scripts(void)
 
 	if (isset(RCS) && unset(PRIVILEGED))
 	{
-	    if (isset(INTERACTIVE)) {
+	    if (interact) {
 		/*
 		 * Always attempt to load the newuser module to perform
 		 * checks for new zsh users.  Don't care if we can't load it.