diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-10-24 15:19:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-10-24 15:19:02 +0000 |
commit | d388baeac3d0b55a29b6ac1b407421cf3a4f79a4 (patch) | |
tree | 0d34a06c60cab341fbb51762cc991db4a7ea29f6 | |
parent | 617c99b6029163f8f768654d6160eefae9536dc5 (diff) |
The default modifier should be copied for empty keys even if -b is
specified. From Cedric Krier.
-rw-r--r-- | usr.bin/sort/sort.c | 11 |
1 files 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 <gabor@FreeBSD.org> @@ -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)); } |