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

PATCH: fix crash in %H when hlgroups is empty



typeset -A .zle.hlgroups; print -P %H
---
 Src/prompt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/prompt.c b/Src/prompt.c
index ec79067cd9..b1e5041bd2 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -257,7 +257,7 @@ parsehighlight(char *arg, char endchar, zattr *atr)
     {
 	Param node;
 	HashTable ht = v->pm->gsu.h->getfn(v->pm);
-	if ((node = (Param) ht->getnode(ht, arg))) {
+	if (ht && (node = (Param) ht->getnode(ht, arg))) {
 	    attrs = node->gsu.s->getfn(node);
 	    entered = 1;
 	    if (match_highlight(attrs, atr, 0) == attrs)
-- 
2.38.1





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