From d60eeab9d2eda8c05ecb27961306468608eb4006 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 8 Jul 2020 07:58:20 -0700 Subject: uref/qref: printing bug. * lib.c (obj_print_impl): The simple_qref_args_p function is called with reversed values of pos. For uref, we want 1, because the first item occurs after the dot, and for qref we want 0, because the first item occurs before the dot. This mix up means that the degenerate syntax (qref X) incorrectly prints as just X instead of (qref X). Likewise, though harmlessly, (uref X) fails to render as .X, instead coming out as (uref X). --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index dc0b7161..b9e510f3 100644 --- a/lib.c +++ b/lib.c @@ -12351,7 +12351,7 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx) put_string(lit(".."), out); obj_print_impl(third(obj), out, pretty, ctx); } else if ((sym == uref_s || sym == qref_s) && - simple_qref_args_p(cdr(obj), if3(sym == uref_s, zero, one))) + simple_qref_args_p(cdr(obj), if3(sym == uref_s, one, zero))) { val iter = cdr(obj), next; -- cgit v1.2.3