aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/sort.c8
-rwxr-xr-xtestsuite/sort.tests3
2 files changed, 6 insertions, 5 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 0b3b650c9..1cb4c3e3f 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -302,10 +302,14 @@ static int compare_keys(const void *xarg, const void *yarg)
302 } /* for */ 302 } /* for */
303 303
304 /* Perform fallback sort if necessary */ 304 /* Perform fallback sort if necessary */
305 if (!retval && !(option_mask32 & FLAG_s)) 305 if (!retval && !(option_mask32 & FLAG_s)) {
306 retval = strcmp(*(char **)xarg, *(char **)yarg); 306 retval = strcmp(*(char **)xarg, *(char **)yarg);
307 flags = option_mask32;
308 }
309
310 if (flags & FLAG_r)
311 return -retval;
307 312
308 if (flags & FLAG_r) return -retval;
309 return retval; 313 return retval;
310} 314}
311 315
diff --git a/testsuite/sort.tests b/testsuite/sort.tests
index 91b282ea0..68fa3e405 100755
--- a/testsuite/sort.tests
+++ b/testsuite/sort.tests
@@ -47,8 +47,6 @@ egg 1 2 papyrus
47999 3 0 algebra 47999 3 0 algebra
48" "$data" "" 48" "$data" ""
49 49
50test x"$SKIP_KNOWN_BUGS" = x"" && {
51# Busybox is definitely doing these wrong. FIXME
52testing "sort key range with numeric option and global reverse" \ 50testing "sort key range with numeric option and global reverse" \
53"sort -k2,3n -r input" \ 51"sort -k2,3n -r input" \
54"egg 1 2 papyrus 52"egg 1 2 papyrus
@@ -65,7 +63,6 @@ testing "sort key range with multiple options" "sort -k2,3rn input" \
6542 1 3 woot 6342 1 3 woot
66egg 1 2 papyrus 64egg 1 2 papyrus
67" "$data" "" 65" "$data" ""
68}
69 66
70testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\ 67testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\
71d 2 68d 2