diff options
author | Tim van der Molen <tim@cvs.openbsd.org> | 2015-10-13 16:21:43 +0000 |
---|---|---|
committer | Tim van der Molen <tim@cvs.openbsd.org> | 2015-10-13 16:21:43 +0000 |
commit | 2b3aaea90a4226e94c8d58aaabef440189581fc0 (patch) | |
tree | b8d6a7bc4ae86f514697a12f97b01718fa0f54fa | |
parent | a0224350a6696ab186a9a953698930fe50f58512 (diff) |
-C and -c allow at most one input file. Ensure this is the case when the
input files are specified through --files0-from.
OK millert@
-rw-r--r-- | usr.bin/sort/sort.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 6594ab63a73..bb0178cb90d 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.79 2015/04/05 13:56:04 millert Exp $ */ +/* $OpenBSD: sort.c,v 1.80 2015/10/13 16:21:42 tim Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org> @@ -1055,6 +1055,11 @@ main(int argc, char *argv[]) } #endif + if (argv_from_file0) { + argc = argc_from_file0; + argv = argv_from_file0; + } + if (sort_opts_vals.cflag && argc > 1) errx(2, "only one input file is allowed with the -%c flag", sort_opts_vals.csilentflag ? 'C' : 'c'); @@ -1091,11 +1096,6 @@ main(int argc, char *argv[]) ks->sm.func = get_sort_func(&(ks->sm)); } - if (argv_from_file0) { - argc = argc_from_file0; - argv = argv_from_file0; - } - if (debug_sort) { printf("Memory to be used for sorting: %llu\n", available_free_memory); |