From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: seg fault with completion
Date: Fri, 20 Jul 2001 12:50:18 +0200 (MET DST) [thread overview]
Message-ID: <200107201050.MAA09449@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <3B57F8FB.6F42295C@yahoo.co.uk>
Oliver Kiddle wrote:
> This is in version 4.0.2 too so is not new.
>
> s=( $a[(<tab> )
> cursor positioned where I have put `<tab>'.
Memory problem and hence not always reproducible.
It was using a pointer to compsuffix which might be freed by
ignore_suffix().
And that loop shouldn't be using `str' anyway, it's `more' there.
This'll go into 4.0.x, too.
Bye
Sven
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.65
diff -u -r1.65 computil.c
--- Src/Zle/computil.c 2001/07/19 08:40:37 1.65
+++ Src/Zle/computil.c 2001/07/20 10:48:53
@@ -2615,19 +2615,21 @@
ign = strlen(as);
}
}
+ more = dupstring(more);
+
if (ign)
ignore_suffix(ign);
while (more && *more) {
- if ((val = cv_next(d, &str, &arg))) {
+ if ((val = cv_next(d, &more, &arg))) {
zaddlinknode(state.vals, ztrdup(val->name));
if (arg) {
- if (str) {
- char sav = str[-1];
+ if (more) {
+ char sav = more[-1];
- str[-1] = '\0';
+ more[-1] = '\0';
zaddlinknode(state.vals, ztrdup(arg));
- str[-1] = sav;
+ more[-1] = sav;
} else {
zaddlinknode(state.vals, tricat(arg, compsuffix, ""));
nosfx = 1;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
prev parent reply other threads:[~2001-07-20 10:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-20 9:25 Oliver Kiddle
2001-07-20 9:41 ` Andrej Borsenkow
2001-07-20 9:46 ` Oliver Kiddle
2001-07-20 10:50 ` Sven Wischnowsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200107201050.MAA09449@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).