From 9a5422582e93056b5398c8d0c566cf356248e8a3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 3 Mar 2011 21:29:09 +0200 Subject: Fixes for asort, asorti, split, patsplit. --- array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 2b3b07f4..b821b5e4 100644 --- a/array.c +++ b/array.c @@ -1239,7 +1239,6 @@ asort_actual(int nargs, ASORT_TYPE how) _("asort: second argument not an array") : _("asorti: second argument not an array")); } - assoc_clear(dest); } array = POP_PARAM(); @@ -1249,7 +1248,8 @@ asort_actual(int nargs, ASORT_TYPE how) _("asorti: first argument not an array")); } - if (dest != NULL) { + if (dest != NULL && dest != array) { + assoc_clear(dest); dup_table(array, dest); array = dest; } -- cgit v1.2.3