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

Re: coredump in "interactive mode" of "menu select"



On Thu, 30 Aug 2007 22:10:49 +0900
"Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> zsh-4.3.4 (or the latest CVS) coredumps in the "interactive mode" of
> the "menu select"  completion.

Yes, that's fairly spectacular.  Thank you, you're analysis is entirely
correct.

Here's the simple quick fix---it's not doing any harm, but there are too
many metafy/unmetafy pairs and it looks like it's not that hard to simplify
the code, when I get round to it (or somebody else does, but that's wishful
thinking).

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.105
diff -u -r1.105 complist.c
--- Src/Zle/complist.c	6 Jul 2007 21:52:40 -0000	1.105
+++ Src/Zle/complist.c	30 Aug 2007 14:22:31 -0000
@@ -2542,10 +2542,20 @@
                 strncpy(zlemetaline, origline, l);
                 zlemetacs = origcs;
 
+		/*
+		 * Horrible quick fix:
+		 * we shouldn't need to metafy and unmetafy
+		 * quite as much.  If we kept unmetafied through
+		 * here we could fix up setmstatus to use unmetafied
+		 * as well.  This is the only use of setmstatus which
+		 * restores the line so that should be doable.
+		 */
+		unmetafy_line();
                 if (cmd == Th(z_selfinsert))
                     selfinsert(zlenoargs);
                 else
                     selfinsertunmeta(zlenoargs);
+		metafy_line();
 
                 saveline = (char *) zhalloc(zlemetall);
                 memcpy(saveline, zlemetaline, zlemetall);
Index: Src/Zle/zle_misc.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_misc.c,v
retrieving revision 1.42
diff -u -r1.42 zle_misc.c
--- Src/Zle/zle_misc.c	19 Apr 2007 14:16:23 -0000	1.42
+++ Src/Zle/zle_misc.c	30 Aug 2007 14:22:32 -0000
@@ -42,6 +42,8 @@
     int m = neg ? -zmult : zmult;    /* number of copies to insert */
     int count;
 
+    UNMETACHECK();
+
     iremovesuffix(c1, 0);
     invalidatelist();
 


.



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