From 9d2a3e3ba7e75d200ee1d9ece7c2accd7451a960 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 22 Jul 2015 07:14:07 -0700 Subject: * lib.c (obj_print, obj_pprint): Bugfix: incorrect value returned when printing dwim forms, due to mutating the obj variable. --- ChangeLog | 6 ++++++ lib.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fec345a..7393869b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-07-22 Kaz Kylheku + + * lib.c (obj_print, obj_pprint): Bugfix: incorrect + value returned when printing dwim forms, due to + mutating the obj variable. + 2015-07-21 Kaz Kylheku Implementing caar, cadr, cdar and friends. diff --git a/lib.c b/lib.c index eba06a71..9bcce5e4 100644 --- a/lib.c +++ b/lib.c @@ -6883,6 +6883,7 @@ val obj_print(val obj, val out) case CONS: case LCONS: { + val obj_in = obj; val sym = car(obj); if (sym == quote_s && consp(cdr(obj)) && !(cdr(cdr(obj)))) { @@ -6949,8 +6950,8 @@ finish: } } } + return obj_in; } - return obj; case LIT: case STR: { @@ -7077,6 +7078,7 @@ val obj_pprint(val obj, val out) case CONS: case LCONS: { + val obj_in = obj; val sym = car(obj); if (sym == quote_s && consp(cdr(obj)) && !(cdr(cdr(obj)))) { @@ -7143,8 +7145,8 @@ finish: } } } + return obj_in; } - return obj; case LIT: case STR: put_string(obj, out); -- cgit v1.2.3