summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 25299bc7..20fb605e 100644
--- a/lib.c
+++ b/lib.c
@@ -475,8 +475,12 @@ val conses(val list)
{
list_collect_decl (out, ptail);
- for (; consp(list); list = cdr(list))
- ptail = list_collect(ptail, list);
+ if (listp(list))
+ for (; consp(list); list = cdr(list))
+ ptail = list_collect(ptail, list);
+ else
+ for (; list; list = cdr(list))
+ ptail = list_collect(ptail, list);
return out;
}