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
commitd60eeab9d2eda8c05ecb27961306468608eb4006 (patch)
tree8cb35b9f24d2739aff281f15e08d580336efbc76
parentbb481714ff3ddc5be9cadc2dcce2889caf63d080 (diff)
downloadtxr-d60eeab9d2eda8c05ecb27961306468608eb4006.tar.gz
txr-d60eeab9d2eda8c05ecb27961306468608eb4006.tar.bz2
txr-d60eeab9d2eda8c05ecb27961306468608eb4006.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;