From: Stephen Dolan Date: Mon, 3 Sep 2012 14:33:59 +0000 (+0100) Subject: Make assignment work again: = and |= operators. X-Git-Tag: jq-1.1~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fe9c8a22a0f43c8e34df5bc92df98c498c9a3f4;p=jq Make assignment work again: = and |= operators. --- diff --git a/c/execute.c b/c/execute.c index c22d1df..0c31e07 100644 --- a/c/execute.c +++ b/c/execute.c @@ -24,14 +24,18 @@ int pathsize; // number of allocated elements // FIXME mem int path_push(stackval sv, jv val) { - return 0; int pos = sv.pathidx; assert(pos <= pathsize); assert(pos >= 0); if (pos == pathsize) { - pathsize = pathsize ? pathsize * 2 : 100; + int oldpathsize = pathsize; + pathsize = oldpathsize ? oldpathsize * 2 : 100; pathbuf = realloc(pathbuf, sizeof(pathbuf[0]) * pathsize); + for (int i=oldpathsize; i