summaryrefslogtreecommitdiff
path: root/Src/init.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2013-11-07 14:52:31 +0100
committerAxel Beckert <abe@deuxchevaux.org>2013-11-07 14:52:31 +0100
commitd799ac78a744a5359563af55b4dee9e91255a1dc (patch)
tree73475ed7089e6ee050085a96b88018994b43bdfc /Src/init.c
parentabfb3b136a4ad5b2832fb7d920442a2bb28c0697 (diff)
parent375115c7dfd6dff576915d25fe2ecdd381dd9d81 (diff)
downloadzsh-d799ac78a744a5359563af55b4dee9e91255a1dc.tar.gz
zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Src/init.c b/Src/init.c
index 8467a739c..7032ff8ae 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -281,9 +281,10 @@ parseargs(char **argv, char **runscript)
/**/
static void
-parseopts_insert(LinkList optlist, void *ptr)
+parseopts_insert(LinkList optlist, void *base, int optno)
{
LinkNode node;
+ void *ptr = base + (optno < 0 ? -optno : optno);
for (node = firstnode(optlist); node; incnode(node)) {
if (ptr < getdata(node)) {
@@ -390,7 +391,7 @@ parseopts(char *nam, char ***argvp, char *new_opts, char **cmdp,
if (dosetopt(optno, action, !nam, new_opts) && nam) {
WARN_OPTION("can't change option: %s", *argv);
} else if (optlist) {
- parseopts_insert(optlist, new_opts+optno);
+ parseopts_insert(optlist, new_opts, optno);
}
}
break;
@@ -415,7 +416,7 @@ parseopts(char *nam, char ***argvp, char *new_opts, char **cmdp,
if (dosetopt(optno, action, !nam, new_opts) && nam) {
WARN_OPTION("can't change option: -%c", **argv);
} else if (optlist) {
- parseopts_insert(optlist, new_opts+optno);
+ parseopts_insert(optlist, new_opts, optno);
}
}
}
@@ -1113,6 +1114,7 @@ init_signals(void)
install_handler(SIGCHLD);
#ifdef SIGWINCH
install_handler(SIGWINCH);
+ winch_block(); /* See utils.c:preprompt() */
#endif
if (interact) {
install_handler(SIGALRM);
@@ -1582,6 +1584,7 @@ zsh_main(UNUSED(int argc), char **argv)
fdtable_size = zopenmax();
fdtable = zshcalloc(fdtable_size*sizeof(*fdtable));
+ fdtable[0] = fdtable[1] = fdtable[2] = FDT_EXTERNAL;
createoptiontable();
emulate(zsh_name, 1, &emulation, opts); /* initialises most options */