1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-23 13:00:34 +02:00

(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.
This commit is contained in:
Kevin Ryde 2007-01-24 23:04:09 +00:00
parent 019618da74
commit 2081b955ad

View file

@ -531,6 +531,9 @@ SCM_DEFINE (scm_stable_sort, "stable-sort", 2, 0, 0,
"This is a stable sort.") "This is a stable sort.")
#define FUNC_NAME s_scm_stable_sort #define FUNC_NAME s_scm_stable_sort
{ {
if (SCM_NULL_OR_NIL_P (items))
return SCM_EOL;
if (scm_is_pair (items)) if (scm_is_pair (items))
return scm_stable_sort_x (scm_list_copy (items), less); return scm_stable_sort_x (scm_list_copy (items), less);
else if (scm_is_vector (items)) else if (scm_is_vector (items))