shithub: riscv

Download patch

ref: e93d22ef184a65418d2cf61268abb616a2752f1f
parent: 6e4554b7d503404f5af8da020de1125c69a20ce8
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;
--