diff options
author | Denys Vlasenko | 2022-01-04 23:53:21 +0100 |
---|---|---|
committer | Denys Vlasenko | 2022-01-04 23:53:21 +0100 |
commit | cc7d2e21780c28608b00a4faf0fed297527bcbf4 (patch) | |
tree | e3fbe3c8461299d14687e490d1b70ea1b80879fd /coreutils/sort.c | |
parent | dfd8aafcf59c88662516a534a4334b3f08f58c88 (diff) | |
download | busybox-cc7d2e21780c28608b00a4faf0fed297527bcbf4.zip busybox-cc7d2e21780c28608b00a4faf0fed297527bcbf4.tar.gz |
sort: fix -s -r interaction: 'stable' order is not affected by -r
function old new delta
compare_keys 818 820 +2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/sort.c')
-rw-r--r-- | coreutils/sort.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index 0cbb6f5..9ff7778 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -380,7 +380,9 @@ static int compare_keys(const void *xarg, const void *yarg) /* If x > y, 1, else -1 */ retval = (x32 > y32) * 2 - 1; - } else + /* Here, -r has no effect! */ + return retval; + } if (!(option_mask32 & FLAG_no_tie_break)) { /* fallback sort */ flags = option_mask32; |