From 824f7df4041b3c580a8211f80080c3ba38f38b73 Mon Sep 17 00:00:00 2001 From: Nicolas Williams <nico@cryptonector.com> Date: Mon, 7 Jul 2014 22:26:07 -0500 Subject: [PATCH] `limit` should use `break` --- builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin.c b/builtin.c index 4febe8fa..9089d47d 100644 --- a/builtin.c +++ b/builtin.c @@ -978,7 +978,7 @@ static const char* const jq_builtins[] = { " def _while: " " if cond then ., (update | _while) else empty end; " " _while;", - "def limit(n; exp): if n < 0 then exp else foreach exp as $item ([n, null]; if .[0] < 1 then empty else [.[0] -1, $item] end; .[1]) end;", + "def limit(n; exp): if n < 0 then exp else foreach exp as $item ([n, null]; if .[0] < 1 then break else [.[0] -1, $item] end; .[1]) end;", }; #undef LIBM_DD