From 362666bc7ad99b2747058472d6f47e2972e9e7af Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 15 Jan 2025 12:42:19 -0800 Subject: 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*. --- lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib.c b/lib.c index fd3a7514..32b701a7 100644 --- a/lib.c +++ b/lib.c @@ -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))); -- cgit v1.2.3