When the input to csplit contains fewer lines than the number of matches
specified, extra output was mistakenly included in some output files.
From FreeBSD via Tim Chase.
-/* $OpenBSD: csplit.c,v 1.9 2016/10/28 07:22:59 schwarze Exp $ */
+/* $OpenBSD: csplit.c,v 1.10 2021/07/08 00:38:42 millert Exp $ */
/* $FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp $ */
/*-
first = 0;
}
- if (p == NULL)
+ if (p == NULL) {
+ toomuch(NULL, 0);
errx(1, "%s: no match", re);
+ }
if (ofs <= 0) {
/*