=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sort/sort.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- src/usr.bin/sort/sort.c 2015/04/03 10:37:24 1.76 +++ src/usr.bin/sort/sort.c 2015/04/03 12:52:48 1.77 @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.76 2015/04/03 10:37:24 tobias Exp $ */ +/* $OpenBSD: sort.c,v 1.77 2015/04/03 12:52:48 millert Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan @@ -1041,6 +1041,10 @@ argc -= optind; argv += optind; + + 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'); if (sflag != NULL) available_free_memory = parse_memory_buffer_value(sflag);