summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-26 07:31:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-26 07:31:57 -0700
commit3ac163ce1fd61384789a0a2943f1f94d47cb3223 (patch)
treed8bc51393525be37965e206eebf7176165b266d1
parentd5e21633e094e4f0a71939c65637d55aa7f9c536 (diff)
downloadtxr-3ac163ce1fd61384789a0a2943f1f94d47cb3223.tar.gz
txr-3ac163ce1fd61384789a0a2943f1f94d47cb3223.tar.bz2
txr-3ac163ce1fd61384789a0a2943f1f94d47cb3223.zip
* lib.c (last): Bugfix: reversed null test.
-rw-r--r--ChangeLog4
-rw-r--r--lib.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b5916346..b69ea1f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2014-06-26 Kaz Kylheku <kaz@kylheku.com>
+ * lib.c (last): Bugfix: reversed null test.
+
+2014-06-26 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (eval_init): register range_regex and tok_where
as intrinsics.
diff --git a/lib.c b/lib.c
index 3846d885..bb0d580f 100644
--- a/lib.c
+++ b/lib.c
@@ -421,7 +421,7 @@ loc lastcons(val list)
val last(val list)
{
loc p = lastcons(list);
- return nullocp(p) ? deref(p) : list;
+ return nullocp(p) ? list : deref(p);
}
loc ltail(loc cons)