From f4f44d658c5179458c57c4af43429aac25bf8546 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Sun, 2 Apr 2006 18:20:24 +0100 Subject: Prevent "use sort 'stable'" from reversing the order Message-ID: <20060402162024.GA3854@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@27689 --- pp_sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pp_sort.c') diff --git a/pp_sort.c b/pp_sort.c index 6e03d0e839..aa1fe80929 100644 --- a/pp_sort.c +++ b/pp_sort.c @@ -363,7 +363,7 @@ S_mergesortsv(pTHX_ gptr *base, size_t nmemb, SVCOMPARE_t cmp, U32 flags) if (nmemb <= 1) return; /* sorted trivially */ - if (flags) { + if ((flags & SORTf_DESC) != 0) { savecmp = PL_sort_RealCmp; /* Save current comparison routine, if any */ PL_sort_RealCmp = cmp; /* Put comparison routine where cmp_desc can find it */ cmp = cmp_desc; -- cgit v1.2.1