about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:24:09 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:24:09 +0000
commit6c1fb551ba0973c9a86e1ea479d553d66c6bf6b7 (patch)
treeec80a986c49f2da21eed83b7097f0f4e99f57e3f /Src/init.c
parent640a840d2e94f0fc245ef8632050c37af23c6b94 (diff)
downloadzsh-6c1fb551ba0973c9a86e1ea479d553d66c6bf6b7.tar.gz
zsh-6c1fb551ba0973c9a86e1ea479d553d66c6bf6b7.tar.xz
zsh-6c1fb551ba0973c9a86e1ea479d553d66c6bf6b7.zip
zsh-3.1.5-pws-14 zsh-3.1.5-pws-14
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/Src/init.c b/Src/init.c
index f3576aadd..9fc4a81fb 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -757,25 +757,43 @@ run_init_scripts(void)
 	source(GLOBAL_ZSHENV);
 #endif
 	if (isset(RCS)) {
+	    int globalfirst = isset(GLOBALRCSFIRST);
+	    if (globalfirst) {
+#ifdef GLOBAL_ZPROFILE
+		if (islogin)
+		    source(GLOBAL_ZPROFILE);
+#endif
+#ifdef GLOBAL_ZSHRC
+		if (interact)
+		    source(GLOBAL_ZSHRC);
+#endif
+#ifdef GLOBAL_ZLOGIN
+		if (islogin)
+		    source(GLOBAL_ZLOGIN);
+#endif
+	    }
 	    if (unset(PRIVILEGED))
 		sourcehome(".zshenv");
 	    if (islogin) {
 #ifdef GLOBAL_ZPROFILE
-		source(GLOBAL_ZPROFILE);
+		if (!globalfirst)
+		    source(GLOBAL_ZPROFILE);
 #endif
 		if (unset(PRIVILEGED))
 		    sourcehome(".zprofile");
 	    }
 	    if (interact) {
 #ifdef GLOBAL_ZSHRC
-		source(GLOBAL_ZSHRC);
+		if (!globalfirst)
+		    source(GLOBAL_ZSHRC);
 #endif
 		if (unset(PRIVILEGED))
 		    sourcehome(".zshrc");
 	    }
 	    if (islogin) {
 #ifdef GLOBAL_ZLOGIN
-		source(GLOBAL_ZLOGIN);
+		if (!globalfirst)
+		    source(GLOBAL_ZLOGIN);
 #endif
 		if (unset(PRIVILEGED))
 		    sourcehome(".zlogin");