1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Allow C-coded functions to empty

Just return a jv_invalid() without a message.
This commit is contained in:
Nicolas Williams
2014-12-26 14:37:38 -06:00
parent bbb287f54b
commit 906d2537b9

View File

@@ -703,9 +703,13 @@ jv jq_next(jq_state *jq) {
if (jv_is_valid(top)) {
stack_push(jq, top);
} else {
} else if (jv_invalid_has_msg(jv_copy(top))) {
set_error(jq, top);
goto do_backtrack;
} else {
// C-coded function returns invalid w/o msg? -> backtrack, as if
// it had returned `empty`
goto do_backtrack;
}
break;
}