From 2b774880b5902810254f4eca09e50d3766e4ec2a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 30 Dec 2019 16:07:14 +0000 Subject: Do not perform top-level sort when -c is used with a -k field. From Richard Ipsum --- usr.bin/sort/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin/sort') 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 @@ -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); -- cgit v1.2.3