Fix regression with changed SUBSEP in subscript (#86)
Commit0d8778bbbb
reintroduced a regression that was fixed in commit97a4b7ed21
. The length of SUBSEP needs to be rechecked after calling execute(), in case SUBSEP itself has been changed. Co-authored-by: Tim van der Molen <tim@kariliq.nl>
This commit is contained in:
parent
cc19af1308
commit
ee5b49bb33
4
run.c
4
run.c
@ -472,7 +472,7 @@ makearraystring(Node *p, const char *func)
|
||||
{
|
||||
char *buf;
|
||||
int bufsz = recsize;
|
||||
size_t blen, seplen;
|
||||
size_t blen;
|
||||
|
||||
if ((buf = malloc(bufsz)) == NULL) {
|
||||
FATAL("%s: out of memory", func);
|
||||
@ -480,11 +480,11 @@ makearraystring(Node *p, const char *func)
|
||||
|
||||
blen = 0;
|
||||
buf[blen] = '\0';
|
||||
seplen = strlen(getsval(subseploc));
|
||||
|
||||
for (; p; p = p->nnext) {
|
||||
Cell *x = execute(p); /* expr */
|
||||
char *s = getsval(x);
|
||||
size_t seplen = strlen(getsval(subseploc));
|
||||
size_t nsub = p->nnext ? seplen : 0;
|
||||
size_t slen = strlen(s);
|
||||
size_t tlen = blen + slen + nsub;
|
||||
|
Loading…
Reference in New Issue
Block a user