awk: fix the fix
be more carefull. have to preserve DONTFREE flag!
This commit is contained in:
parent
6e4554b7d5
commit
e93d22ef18
|
@ -1213,9 +1213,10 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */
|
||||||
FATAL("illegal type of split");
|
FATAL("illegal type of split");
|
||||||
sep = *fs;
|
sep = *fs;
|
||||||
ap = execute(a[1]); /* array name */
|
ap = execute(a[1]); /* array name */
|
||||||
|
n = y->tval;
|
||||||
y->tval |= DONTFREE; /* split(a[x], a); */
|
y->tval |= DONTFREE; /* split(a[x], a); */
|
||||||
freesymtab(ap);
|
freesymtab(ap);
|
||||||
y->tval &= ~DONTFREE;
|
y->tval = n;
|
||||||
dprintf( ("split: s=|%s|, a=%s, sep=|%s|\n", s, ap->nval, fs) );
|
dprintf( ("split: s=|%s|, a=%s, sep=|%s|\n", s, ap->nval, fs) );
|
||||||
ap->tval &= ~STR;
|
ap->tval &= ~STR;
|
||||||
ap->tval |= ARR;
|
ap->tval |= ARR;
|
||||||
|
|
Loading…
Reference in a new issue