From 4fec788fa5f6e7c9723e02e3d0b57068ce9785aa Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 19 May 1999 13:10:41 +0000 Subject: zsh-3.1.5-pws-19 --- Src/options.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'Src/options.c') diff --git a/Src/options.c b/Src/options.c index c0042a662..36030f516 100644 --- a/Src/options.c +++ b/Src/options.c @@ -45,15 +45,6 @@ char opts[OPT_SIZE]; /**/ HashTable optiontab; -typedef struct optname *Optname; - -struct optname { - HashNode next; /* next in hash chain */ - char *nam; /* hash data */ - int flags; - int optno; /* option number */ -}; - /* The canonical option name table */ #define OPT_CSH EMULATE_CSH @@ -73,6 +64,10 @@ struct optname { #define defset(X) (!!((X)->flags & emulation)) +/* + * Note that option names should usually be fewer than 20 characters long + * to avoid formatting problems. + */ static struct optname optns[] = { {NULL, "allexport", 0, ALLEXPORT}, {NULL, "alwayslastprompt", OPT_ALL, ALWAYSLASTPROMPT}, @@ -137,7 +132,7 @@ static struct optname optns[] = { {NULL, "hup", OPT_EMULATE|OPT_ZSH, HUP}, {NULL, "ignorebraces", OPT_EMULATE|OPT_SH, IGNOREBRACES}, {NULL, "ignoreeof", 0, IGNOREEOF}, -{NULL, "incrementalappendhistory",0, INCREMENTALAPPENDHISTORY}, +{NULL, "incappendhistory", 0, INCAPPENDHISTORY}, {NULL, "interactive", OPT_SPECIAL, INTERACTIVE}, {NULL, "interactivecomments", OPT_EMULATE|OPT_BOURNE, INTERACTIVECOMMENTS}, {NULL, "ksharrays", OPT_EMULATE|OPT_BOURNE, KSHARRAYS}, @@ -443,6 +438,17 @@ emulate(const char *zsh_name, int fully) { char ch = *zsh_name; + if (!strcmp("su", zsh_name)) { + /* We haven't set up the paramtable yet, so just use zgetenv */ + char *ptr = zgetenv("SHELL"); + if (ptr && *ptr) { + zsh_name = ptr; + if ((ptr = strrchr(zsh_name, '/'))) + zsh_name = ptr+1; + ch = *zsh_name; + } else + ch = 'z'; + } if (ch == 'r') ch = zsh_name[1]; -- cgit 1.4.1