From 2081b955ad4e90f70d27cf61e036bac302dfb14e Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Wed, 24 Jan 2007 23:04:09 +0000 Subject: [PATCH] (scm_stable_sort): Return empty list for input empty list, as done in guile 1.6 and as always done by plain `sort'. Was falling through to SCM_WRONG_TYPE_ARG. --- libguile/sort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libguile/sort.c b/libguile/sort.c index ff33e1ee8..f40d62a7b 100644 --- a/libguile/sort.c +++ b/libguile/sort.c @@ -531,6 +531,9 @@ SCM_DEFINE (scm_stable_sort, "stable-sort", 2, 0, 0, "This is a stable sort.") #define FUNC_NAME s_scm_stable_sort { + if (SCM_NULL_OR_NIL_P (items)) + return SCM_EOL; + if (scm_is_pair (items)) return scm_stable_sort_x (scm_list_copy (items), less); else if (scm_is_vector (items))