Skip to content
Suresoft-GLaDOS edited this page May 26, 2023 · 9 revisions

#1

Link : https://github.com/zsh-users/zsh/commit/db46c9cd5844240fb6015666c8e2a12a0a3a6ead
Description: Fix leaving behind obsolete directories

At Src/exec.c

@@ -4622,7 +4622,7 @@ getoutput(char *cmd, int qt)
     char *s;
     int onc = nocomments;
+    nocomments = (interact && !sourcelevel && unset(INTERACTIVECOMMENTS));
-    nocomments = (interact && unset(INTERACTIVECOMMENTS));
     prog = parse_string(cmd, 0);
     nocomments = onc;

Tags
#Omission #Single-line #Modified

#2

Link : https://github.com/zsh-users/zsh/commit/2a7945a900c8a1b1866ad31ee5e95db5b0ddb50a
Description: Fix segfault by 'bindkey -d' with reordered keymapnamtab

At Src/Zle/zle_keymap.c

@@ -155,7 +155,7 @@ createkeymapnamtab(void)
     keymapnamtab = newhashtable(7, "keymapnamtab", NULL);
     keymapnamtab->hash        = hasher;
+    keymapnamtab->emptytable  = emptykeymapnamtab;
-    keymapnamtab->emptytable  = emptyhashtable;
     keymapnamtab->filltable   = NULL;
     keymapnamtab->cmpnodes    = strcmp;
     keymapnamtab->addnode     = addhashnode;
@@ -179,25 +179,6 @@ makekeymapnamnode(Keymap keymap)
 }
 /**/
+static void
+emptykeymapnamtab(HashTable ht)
+{
+    struct hashnode *hn, *hp;
+    int i;
+
+    for (i = 0; i < ht->hsize; i++) {
+	for (hn = ht->nodes[i]; hn;) {
+	    KeymapName kmn = (KeymapName) hn;
+	    hp = hn->next;
+	    zsfree(kmn->nam);
+	    unrefkeymap(kmn->keymap);
+	    zfree(kmn, sizeof(*kmn));
+	    hn = hp;
+	}
+	ht->nodes[i] = NULL;
+    }
+    ht->ct = 0;
+}
 /*
  * Reference a keymap from a keymapname.

Tags
#Memory-error #Multi-line #Modified

#3

Link : https://github.com/zsh-users/zsh/commit/daa208e90763d304dc1d554a834d0066e0b9937c
Description: Fix "[ ! -o ]".

At Src/parse.c

@@ -2509,7 +2509,7 @@ par_cond_2(void)
 	 * In "test" compatibility mode, "! -a ..." and "! -o ..."
 	 * are treated as "[string] [and] ..." and "[string] [or] ...".
 	 */
+	if (!(n_testargs > 2 && (check_cond(*testargs, "a") ||
-	if (!(n_testargs > 1 && (check_cond(*testargs, "a") ||
 				 check_cond(*testargs, "o"))))
 	{
 	    condlex();

Tags
#Invalid-condition #Single-line #Modified

#4

Link : https://github.com/zsh-users/zsh/commit/9b3a2924101c4e17dbb9c0b8745dc4eb9cdca910
Description: Fix coredump in ${name:offset:length} with ill-formatted length

At Src/subst.c

@@ -3362,15 +3362,13 @@ colonsubscript:
 		    return NULL;
 		}
 		if (*check_offset2) {
+		    char *nextp;
 		    check_offset = check_colon_subscript(check_offset2 + 1,
+							 &nextp);
-							 &check_offset2);
-		    if (*check_offset2 && *check_offset2 != ':') {
-			zerr("invalid length: %s", check_offset);
-			return NULL;
-		    }
 		    if (check_offset) {
+			check_offset2 = nextp;
+			if (*check_offset2 && *check_offset2 != ':') {
+			    zerr("invalid length: %s", check_offset);
+			    return NULL;
+			}
 			length = mathevali(check_offset);
 			length_set = 1;
 			if (errflag)

Tags
#Invalid-format-string #Multi-line #Modified

#5

Link : https://github.com/zsh-users/zsh/commit/283d2f3c2761ac549a647638bb7d8fd8de3dabb4
Description: Fix quotiing of zstyle -L for zstyle -e

At Src/Modules/zutil.c

@@ -200,8 +200,7 @@ printstylenode(HashNode hn, int printflags)
 	else {
 	    printf("zstyle %s", (p->eval ? "-e " : ""));
 	    quotedzputs(p->pat, stdout);
+	    putchar(' ');
+	    quotedzputs(s->node.nam, stdout);
-	    printf(" %s", s->node.nam);
 	}
 	for (v = p->vals; *v; v++) {
 	    putchar(' ');

Tags
#Etc #Multi-line #Modified

Clone this wiki locally