From: millert Date: Sat, 24 Oct 2015 15:19:01 +0000 (+0000) Subject: The default modifier should be copied for empty keys even if -b is X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=21814ff6a6625912e7b86b14904562b50848cb20;p=openbsd The default modifier should be copied for empty keys even if -b is specified. From Cedric Krier. --- 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)); }