Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh crashes with floating point exception
- X-seq: zsh-users 12230
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: zsh crashes with floating point exception
- Date: Mon, 19 Nov 2007 16:45:12 +0000
- In-reply-to: <20071119163151.GC29766@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20071119142811.GF12829@xxxxxxxxx> <200711191514.lAJFEb7E003678@xxxxxxxxxxxxxx> <20071119155749.GA29766@xxxxxxxxx> <200711191624.lAJGOcA1018650@xxxxxxxxxxxxxx> <20071119163151.GC29766@xxxxxxxxx>
Andy Spiegl wrote:
> > At this point in debugging, could you run
>
> (gdb) p kringnum
> $1 = 0
> (gdb) p kringsize
> $2 = 0
> (gdb) p kring
> $3 = (struct cutbuffer *) 0x819cba0
Thanks.
I'm more convinced than ever you haven't got the default widget. Could
you run "zle -lL | grep backward-kill-line", and if that shows something,
"which <function>" where <function> is the last word on the line?
If that doesn't show anything, I'm stumped, but I'll look again when I
have got more time.
Regardless of whether it does or not, I think I like the following
patch (applies to 4.3.4 and the state of the art)...
Index: Src/Zle/zle_params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_params.c,v
retrieving revision 1.29
diff -u -r1.29 zle_params.c
--- Src/Zle/zle_params.c 19 May 2006 10:16:01 -0000 1.29
+++ Src/Zle/zle_params.c 19 Nov 2007 16:43:21 -0000
@@ -497,16 +497,18 @@
*/
int kpos = 0;
kringsize = arrlen(x);
- kring = (Cutbuffer)zshcalloc(kringsize * sizeof(struct cutbuffer));
- for (p = x; *p; p++) {
- int n, len = strlen(*p);
- kptr = kring + kpos;
-
- kptr->buf = stringaszleline(*p, 0, &n, NULL, NULL);
- kptr->len = n;
-
- zfree(*p, len+1);
- kpos = (kpos + kringsize -1 ) % kringsize;
+ if (kringsize != 0) {
+ kring = (Cutbuffer)zshcalloc(kringsize * sizeof(struct cutbuffer));
+ for (p = x; *p; p++) {
+ int n, len = strlen(*p);
+ kptr = kring + kpos;
+
+ kptr->buf = stringaszleline(*p, 0, &n, NULL, NULL);
+ kptr->len = n;
+
+ zfree(*p, len+1);
+ kpos = (kpos + kringsize -1 ) % kringsize;
+ }
}
free(x);
}
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author