Skip to content

Commit

Permalink
windows...
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaaaaaaaa committed Aug 25, 2024
1 parent fb7a929 commit 87f8e1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,9 +1355,10 @@ static jv f_output(jq_state *jq, jv input, jv filename, jv data) {
if (sandbox) {
fprintf(stderr, "jq: dry run: %s\n", name_str);
} else {
FILE *fp = fopen(name_str, "w");
FILE *fp = fopen(name_str, "wb");
if (!fp) {
fprintf(stderr, "jq: error: could not open %s\n", name_str);
perror("fopen");
fprintf(stderr, "jq: error: could not open %s for writing\n", name_str);
} else {
if (jv_get_kind(data) == JV_KIND_STRING)
priv_fwrite(jv_string_value(data), jv_string_length_bytes(jv_copy(data)), fp, 0);
Expand Down

0 comments on commit 87f8e1e

Please sign in to comment.