git: 9front

Download patch

ref: 9e2d5f6a2c90b1b450e83e768d9e24edc218ff46
parent: b2245e1ada3af682b032b73a232690898a6936c2
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Mon Dec 10 04:19:41 EST 2012

awk: fix the fix

be more carefull. have to preserve DONTFREE flag!

--- a/sys/src/cmd/awk/run.c
+++ b/sys/src/cmd/awk/run.c
@@ -1213,9 +1213,10 @@
 		FATAL("illegal type of split");
 	sep = *fs;
 	ap = execute(a[1]);	/* array name */
+	n = y->tval;
 	y->tval |= DONTFREE;	/* split(a[x], a); */
 	freesymtab(ap);
-	y->tval &= ~DONTFREE;
+	y->tval = n;
 	   dprintf( ("split: s=|%s|, a=%s, sep=|%s|\n", s, ap->nval, fs) );
 	ap->tval &= ~STR;
 	ap->tval |= ARR;
--