diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 14:37:38 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 23:05:56 -0600 |
commit | 906d2537b9d0384985ed6259ef77ca1bd3d503ed (patch) | |
tree | 9fff6cbc7e390ae48a52cfb102cbe17de7b7e9b6 | |
parent | bbb287f54bbea23e37b44c5938e423d485c4fe8b (diff) |
Allow C-coded functions to `empty`
Just return a jv_invalid() without a message.
-rw-r--r-- | execute.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; } |