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
This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-07-07 11:13:28 -05:00
1 parent 0ecededefa
commit cd8898d5b9
1 file changed
+2
+2
View File
@@ -692,6 +692,8 @@ int main(int argc, char* argv[]) {
ret = process(jq, value, jq_flags, dumpopts); ret = process(jq, value, jq_flags, dumpopts);
if (ret <= 0 && ret != JQ_OK_NO_OUTPUT) if (ret <= 0 && ret != JQ_OK_NO_OUTPUT)
last_result = (ret != JQ_OK_NULL_KIND); last_result = (ret != JQ_OK_NULL_KIND);
if (jq_halted(jq))
break;
continue; continue;
} }