diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-15 12:42:19 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-15 12:42:19 -0800 |
commit | 23adf30aa61e913b7cd221c9ecdf510d1a79d125 (patch) | |
tree | b8e1582b38e474d0f0d31c63c0a7873984dc8eb9 | |
parent | 58cf667aa73134c7945b0be77ed92f1c8fbc5be9 (diff) | |
download | txr-23adf30aa61e913b7cd221c9ecdf510d1a79d125.tar.gz txr-23adf30aa61e913b7cd221c9ecdf510d1a79d125.tar.bz2 txr-23adf30aa61e913b7cd221c9ecdf510d1a79d125.zip |
put_json: bug: incorrect defaulting of flat argument.
this also affects put_jsonl and tojson.
* lib.c (put_json): The flat argument must be properly
defaulted. Without this we are treating it as true when it
is missing due to the convention that missing args are
signaled by the : symbol. This bugs breaks the ability
to use the :standard value for *print-json-format*.
-rw-r--r-- | lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -15857,10 +15857,11 @@ val tostringp(val obj) return get_string_from_stream(ss); } -val put_json(val obj, val stream_in, val flat) +val put_json(val obj, val stream_in, val flat_in) { + val flat = default_null_arg(flat_in); val stream = default_arg_strict(stream_in, std_output); - val imode = if3(default_null_arg(flat), + val imode = if3(flat, set_indent_mode(stream, num_fast(indent_foff)), test_set_indent_mode(stream, num_fast(indent_off), num_fast(indent_data))); |