summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2006-04-02 18:20:24 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-02 21:13:16 +0000
commitf4f44d658c5179458c57c4af43429aac25bf8546 (patch)
tree923d398b4a2556e81e6b8454ae78aef91dd334e4 /pp_sort.c
parent9f7f391326e967b539b86ed051c163bbf8f6e7de (diff)
downloadperl-f4f44d658c5179458c57c4af43429aac25bf8546.tar.gz
Prevent "use sort 'stable'" from reversing the order
Message-ID: <20060402162024.GA3854@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@27689
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c2
1 files changed, 1 insertions, 1 deletions
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;