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

Re: Patch for curses module



On Sep 12,  4:44pm, Sebastian Gniazdowski wrote:
}
} As it can be seen, hash misses are caused by the DISABLED flag ( "if
} (hp->flags & DISABLED) {" in function gethashnode). I attach two files
} with debug prints that produced the output. --- lines are hash table
} dumps, == are gethashnode() interiors. Can someone explain why
} sometimes a node has the DISABLED flag?

Try this?


diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index 0054aef..64329f6 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -370,7 +370,7 @@ zcurses_colorget(const char *nam, char *colorpair)
 	    return NULL;
 	}
 
-	cpn = (Colorpairnode)zalloc(sizeof(struct colorpairnode));
+	cpn = (Colorpairnode)zshcalloc(sizeof(struct colorpairnode));
 	
 	if (!cpn) {
 	    zsfree(cp);
@@ -462,7 +462,7 @@ zccmd_init(const char *nam, char **args)
 	    use_default_colors();
 #endif
 	    /* Initialise the default color pair, always 0 */
-	    cpn = (Colorpairnode)zalloc(sizeof(struct colorpairnode));
+	    cpn = (Colorpairnode)zshcalloc(sizeof(struct colorpairnode));
 	    if (cpn) {
 		cpn->colorpair = 0;
 		addhashnode(zcurses_colorpairs,



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