summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-29 19:39:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-29 19:39:45 -0700
commitd428a0e222590c1eb20c7abdf2905ff0ebddc69a (patch)
tree3ad3f6ccdd72adfce748124e1b5026b96f92d080 /lib.c
parent7a0851c446dc6d128b1c49e21cc9d356bd7debc3 (diff)
downloadtxr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.tar.gz
txr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.tar.bz2
txr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.zip
Bugfix: cannot print (lambda . 42) structure.
* lib.c (obj_print, obj_pprint): Fix mistake in the test for properly formed lambda syntax whcih is printed specially.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index c4c3edae..611aef91 100644
--- a/lib.c
+++ b/lib.c
@@ -6734,7 +6734,7 @@ val obj_print(val obj, val out)
put_char(chr('('), out);
}
- if (sym == lambda_s && cdr(obj) && symbolp(second(obj))) {
+ if (sym == lambda_s && consp(cdr(obj)) && symbolp(second(obj))) {
obj_print(sym, out);
if (second(obj)) {
put_string(lit(" (. "), out);
@@ -6928,7 +6928,7 @@ val obj_pprint(val obj, val out)
put_char(chr('('), out);
}
- if (sym == lambda_s && cdr(obj) && symbolp(second(obj))) {
+ if (sym == lambda_s && consp(cdr(obj)) && symbolp(second(obj))) {
obj_print(sym, out);
if (second(obj)) {
put_string(lit(" (. "), out);