* PATCH: zsh/newuser shouldn't run in emulation
@ 2005-12-09 12:43 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2005-12-09 12:43 UTC (permalink / raw)
To: Zsh hackers list
I've added an explicit test to zsh/newuser that it shouldn't run when
emulating another shell. Actually, this was already covered for sh and
ksh because they take a different branch during initialisation, but I'd
prefer it to be explicit within the module.
Index: Doc/Zsh/mod_newuser.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_newuser.yo,v
retrieving revision 1.1
diff -u -r1.1 mod_newuser.yo
--- Doc/Zsh/mod_newuser.yo 20 Jul 2005 16:08:22 -0000 1.1
+++ Doc/Zsh/mod_newuser.yo 9 Dec 2005 12:25:05 -0000
@@ -12,7 +12,9 @@
On loading, the module tests if any of the start-up files tt(.zshenv),
tt(.zprofile), tt(.zshrc) or tt(.zlogin) exist in the directory given by
the environment variable tt(ZDOTDIR), or the user's home directory if that
-is not set.
+is not set. The test is not performed and the module halts processing if
+the shell was in an emulation mode (i.e. had been invoked as some other
+shell than zsh).
If none of the start-up files were found, the module then looks for the
file tt(newuser) first in a sitewide directory, usually the parent
Index: Src/options.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/options.c,v
retrieving revision 1.24
diff -u -r1.24 options.c
--- Src/options.c 8 Aug 2005 16:49:10 -0000 1.24
+++ Src/options.c 9 Dec 2005 12:25:07 -0000
@@ -33,7 +33,7 @@
/* current emulation (used to decide which set of option letters is used) */
/**/
-int emulation;
+mod_export int emulation;
/* the options; e.g. if opts[SHGLOB] != 0, SH_GLOB is turned on */
Index: Src/Modules/newuser.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/newuser.c,v
retrieving revision 1.1
diff -u -r1.1 newuser.c
--- Src/Modules/newuser.c 20 Jul 2005 16:08:23 -0000 1.1
+++ Src/Modules/newuser.c 9 Dec 2005 12:25:07 -0000
@@ -64,6 +64,9 @@
0 };
const char **sp;
+ if (emulation != EMULATE_ZSH)
+ return;
+
if (!dotdir)
dotdir = home;
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-12-09 12:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-09 12:43 PATCH: zsh/newuser shouldn't run in emulation Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).