Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: seg fault with completion
- X-seq: zsh-workers 15433
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: seg fault with completion
- Date: Fri, 20 Jul 2001 12:50:18 +0200 (MET DST)
- In-reply-to: <3B57F8FB.6F42295C@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author