diff options
author | Nicolas Williams <nico@cryptonector.com> | 2015-07-10 12:32:11 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2015-07-10 12:32:11 -0500 |
commit | f183b57ed53fb24171f3c31c49dde0bea973accc (patch) | |
tree | f1c1ae90f8892a7d527d258e50334026fe16fffd | |
parent | dc4dfdff172620649c72f4c4626e565959589276 (diff) |
input_filename should never empty
-rw-r--r-- | builtin.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1221,7 +1221,11 @@ static jv f_now(jq_state *jq, jv a) { #endif static jv f_current_filename(jq_state *jq) { - return jq_util_input_get_current_filename(jq); + jv r = jq_util_input_get_current_filename(jq); + if (jv_is_valid(r)) + return r; + jv_free(r); + return jv_null(); } static jv f_current_line(jq_state *jq) { return jq_util_input_get_current_line(jq); |