From 21814ff6a6625912e7b86b14904562b50848cb20 Mon Sep 17 00:00:00 2001 From: millert Date: Sat, 24 Oct 2015 15:19:01 +0000 Subject: [PATCH] The default modifier should be copied for empty keys even if -b is specified. From Cedric Krier. --- usr.bin/sort/sort.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 9b61cbe74fe..0b349f0d898 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.84 2015/10/18 17:02:03 millert Exp $ */ +/* $OpenBSD: sort.c,v 1.85 2015/10/24 15:19:01 millert Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan @@ -1147,11 +1147,12 @@ main(int argc, char *argv[]) ks = &(keys[i]); - if (sort_modifier_empty(&(ks->sm)) && !(ks->pos1b) && - !(ks->pos2b)) { + if (sort_modifier_empty(&(ks->sm))) { #ifdef GNUSORT_COMPATIBILITY - ks->pos1b = sm->bflag; - ks->pos2b = sm->bflag; + if (!(ks->pos1b) && !(ks->pos2b)) { + ks->pos1b = sm->bflag; + ks->pos2b = sm->bflag; + } #endif memcpy(&(ks->sm), sm, sizeof(struct sort_mods)); } -- 2.20.1