Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Crash in copy-earlier-word



On Sat, 22 Oct 2005 18:29:04 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> If i type a few words and then press copy-earlier-word a few times, i
> get this backtrace. seems to be at or after it reaches the first word
> on the line.

Thanks for spotting another one:  this was was because insertlastword()
wasn__t consistently remetafying the line if it returned in error.  I__ve
added another UMETACHECK() in the handler for the zle builtin so that
this sort of problem emerges a bit earlier.

I__ve already committed this because of problems with my ISP__s mail
server.

Index: Src/Zle/zle_hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v
retrieving revision 1.28
diff -u -r1.28 zle_hist.c
--- Src/Zle/zle_hist.c	26 Sep 2005 18:39:21 -0000	1.28
+++ Src/Zle/zle_hist.c	23 Oct 2005 17:14:57 -0000
@@ -577,13 +577,17 @@
 	 * a deleted word, because that can only have come
 	 * from a non-empty line.  I think.
 	 */
-	if (!(l = bufferwords(NULL, NULL, NULL)))
+	if (!(l = bufferwords(NULL, NULL, NULL))) {
+	    unmetafy_line();
 	    return 1;
+	}
 	nwords = countlinknodes(l);
     } else {
 	/* Some stored line. */
-	if (!(he = quietgethist(evhist)) || !he->nwords)
+	if (!(he = quietgethist(evhist)) || !he->nwords) {
+	    unmetafy_line();
 	    return 1;
+	}
 	nwords = he->nwords;
     }
     if (wordpos) {
@@ -602,6 +606,7 @@
 	 * has not changed, and lastinsert is still valid.
 	 */
 	lasthist = evhist;
+	unmetafy_line();
 	return 1;
     }
     /*
Index: Src/Zle/zle_thingy.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_thingy.c,v
retrieving revision 1.19
diff -u -r1.19 zle_thingy.c
--- Src/Zle/zle_thingy.c	29 Sep 2005 17:32:38 -0000	1.19
+++ Src/Zle/zle_thingy.c	23 Oct 2005 17:14:58 -0000
@@ -358,6 +358,8 @@
     struct opn const *op, *opp;
     int n;
 
+    UNMETACHECK();
+
     /* select operation and ensure no clashing arguments */
     for(op = opns; op->o && !OPT_ISSET(ops,STOUC(op->o)); op++) ;
     if(op->o)



Messages sorted by: Reverse Date, Date, Thread, Author