From 79956c8a0c91208e104350da311f2bbcca7999d8 Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Fri, 7 Jul 2023 18:06:58 +0200 Subject: [PATCH] exit immediately after halt or halt_error is called Instead of continuing to the next input, and only exiting if there are no more inputs. Closes #2533 --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index c5a47c8fd9..355e4bfc78 100644 --- a/src/main.c +++ b/src/main.c @@ -692,6 +692,8 @@ int main(int argc, char* argv[]) { ret = process(jq, value, jq_flags, dumpopts); if (ret <= 0 && ret != JQ_OK_NO_OUTPUT) last_result = (ret != JQ_OK_NULL_KIND); + if (jq_halted(jq)) + break; continue; }