diff options
author | Denys Vlasenko | 2022-07-29 16:40:00 +0200 |
---|---|---|
committer | Denys Vlasenko | 2022-07-29 16:40:00 +0200 |
commit | 5479c435fde32e720af5e177e95d6364a422885a (patch) | |
tree | 2368af30b56c3be0f8e4a14cc7d09be0ebfa03c1 /coreutils | |
parent | 00f2a35b835c6f49617f5379073e9063e7e683ce (diff) | |
download | busybox-5479c435fde32e720af5e177e95d6364a422885a.zip busybox-5479c435fde32e720af5e177e95d6364a422885a.tar.gz |
sort: fix sort -s -u, closes 14871
function old new delta
sort_main 851 856 +5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/sort.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index 80b578f..01b7c44 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -652,11 +652,12 @@ int sort_main(int argc UNUSED_PARAM, char **argv) /* Handle -u */ if (option_mask32 & FLAG_u) { int j = 0; - /* coreutils 6.3 drop lines for which only key is the same - * -- disabling last-resort compare, or else compare_keys() - * will be the same only for completely identical lines. + /* coreutils 6.3 drop lines for which only key is the same: + * - disabling last-resort compare, or else compare_keys() + * will be the same only for completely identical lines + * - disabling -s (same reasons) */ - option_mask32 |= FLAG_no_tie_break; + option_mask32 = (option_mask32 | FLAG_no_tie_break) & (~FLAG_s); for (i = 1; i < linecount; i++) { if (compare_keys(&lines[j], &lines[i]) == 0) free(lines[i]); |