Skip to content
Myr

src/main.c: fix issue #1587 by using jv_dumpf in the raw-output and ascii-output case. retain fwrite in the raw-output case.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by rain1 · committed by Nico Williams · parent ae11f11 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:src/main.c+5 added-1 removed
165 unmodified lines
166 jq_start(jq, value, flags);167 jv result;168 while (jv_is_valid(result = jq_next(jq))) {169 if ((options & RAW_OUTPUT) && jv_get_kind(result) == JV_KIND_STRING) {170 if (options & ASCII_OUTPUT) {171 jv_dumpf(result, stdout, JV_PRINT_ASCII);172 } else {170 fwrite(jv_string_value(result), 1, jv_string_length_bytes(jv_copy(result)), stdout);173 fwrite(jv_string_value(result), 1, jv_string_length_bytes(jv_copy(result)), stdout);174 }175 ret = 0;176 jv_free(result);177 } else {178 if (jv_get_kind(result) == JV_KIND_FALSE || jv_get_kind(result) == JV_KIND_NULL)
490 unmodified lines