From: Jim Meyering Date: Tue, 25 Jul 1995 04:50:04 +0000 (+0000) Subject: (main): When too few arguments are given, don't just X-Git-Tag: textutils-1_12_1~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7732d5d7cfd6326e5457953a25ba447034d7ff14;p=thirdparty%2Fcoreutils.git (main): When too few arguments are given, don't just issue the usage message; also report why. --- diff --git a/src/csplit.c b/src/csplit.c index 9fbf0e35fe..6c1b6d2cd2 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -1524,8 +1524,11 @@ main (argc, argv) if (show_help) usage (0); - if (optind >= argc - 1) - usage (1); + if (argc - optind < 2) + { + error (0, 0, "too few arguments"); + usage (1); + } if (suffix) filename_space = (char *) xmalloc (strlen (prefix) + max_out (suffix) + 2);