summaryrefslogtreecommitdiff
path: root/usr.bin/sort
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2019-12-30 16:07:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2019-12-30 16:07:14 +0000
commit2b774880b5902810254f4eca09e50d3766e4ec2a (patch)
tree0a6b4e83dde0c53bd9d8a3d915f44939772dbe0a /usr.bin/sort
parentd1ae7e2e00331dc71ab7b8f0aab12d28e3934d5f (diff)
Do not perform top-level sort when -c is used with a -k field.
From Richard Ipsum
Diffstat (limited to 'usr.bin/sort')
-rw-r--r--usr.bin/sort/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c
index 9d84d7cb4f6..d3b97f5b2df 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.22 2019/05/15 09:07:46 schwarze Exp $ */
+/* $OpenBSD: file.c,v 1.23 2019/12/30 16:07:13 millert Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -387,7 +387,8 @@ check(const char *fn)
printf("; cmp1=%d", cmp);
if (!cmp && sort_opts_vals.complex_sort &&
- !(sort_opts_vals.uflag) && !(sort_opts_vals.sflag)) {
+ !(sort_opts_vals.uflag) && !(sort_opts_vals.sflag) &&
+ !(sort_opts_vals.kflag)) {
cmp = top_level_str_coll(s2, s1);
if (debug_sort)
printf("; cmp2=%d", cmp);