Fix concatenation regression (#85)
The optimization in commit1d6ddfd9c0
reintroduced the regression that was fixed in commite26237434f
. Co-authored-by: Tim van der Molen <tim@kariliq.nl>
This commit is contained in:
parent
f232de85f6
commit
cc19af1308
6
run.c
6
run.c
|
@ -1192,12 +1192,12 @@ Cell *cat(Node **a, int q) /* a[0] cat a[1] */
|
|||
|
||||
x = execute(a[0]);
|
||||
n1 = strlen(getsval(x));
|
||||
adjbuf(&s, &ssz, n1, recsize, 0, "cat1");
|
||||
memcpy(s, x->sval, n1);
|
||||
|
||||
y = execute(a[1]);
|
||||
n2 = strlen(getsval(y));
|
||||
|
||||
adjbuf(&s, &ssz, n1 + n2 + 1, recsize, 0, "cat");
|
||||
memcpy(s, x->sval, n1);
|
||||
adjbuf(&s, &ssz, n1 + n2 + 1, recsize, 0, "cat2");
|
||||
memcpy(s + n1, y->sval, n2);
|
||||
s[n1 + n2] = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue