Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Augmenting a Sticky Emulation Mode
- X-seq: zsh-workers 31361
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Russell Harmon <russ@xxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: Augmenting a Sticky Emulation Mode
- Date: Mon, 29 Apr 2013 14:17:17 -0700
- In-reply-to: <130429114756.ZM16140@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CA+zrezRfVDfTHYMMj2HpeyrUJvyuTQ=p+PL0tV6u3hcZ1nOfAw@mail.gmail.com> <130426180127.ZM18989@torch.brasslantern.com> <CA+zrezROkjsD5mum5TCZ02h5Z+MTWiHC59cyuAyt1J0xpgUG+g@mail.gmail.com> <CA+zrezTCVO58URokScwT45VHa_MkgpvnEuNbvzB+Uk97+WpQRQ@mail.gmail.com> <20130429094700.6c8db4a9@pwslap01u.europe.root.pri> <CA+zrezT4Xn6sUPciVd=6m2M=gfTavnA8MzcjL11AzxmAGUfowA@mail.gmail.com> <CA+zrezS4X+=rkp42WWqcYC3eFZL95DgPHmKkGaEJj+R6ZB2BNg@mail.gmail.com> <130429111141.ZM16086@torch.brasslantern.com> <130429114756.ZM16140@torch.brasslantern.com>
On Apr 29, 11:47am, Bart Schaefer wrote:
}
} OK, I found the problem, but I don't know what to do to fix it.
This seems to do it.
diff --git a/Src/init.c b/Src/init.c
index 8467a73..49ac124 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);
}
}
}
--
Barton E. Schaefer
Messages sorted by:
Reverse Date,
Date,
Thread,
Author