summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-07-08 07:58:20 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-07-08 07:58:20 -0700
commit467ddd7b2b69fb87bb550cf30f9fa34af44f9927 (patch)
tree8cb35b9f24d2739aff281f15e08d580336efbc76
parente3380bee788f63bb19248e0f5bbe2a869243e982 (diff)
downloadtxr-467ddd7b2b69fb87bb550cf30f9fa34af44f9927.tar.gz
txr-467ddd7b2b69fb87bb550cf30f9fa34af44f9927.tar.bz2
txr-467ddd7b2b69fb87bb550cf30f9fa34af44f9927.zip
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).
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
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;