From 7732d5d7cfd6326e5457953a25ba447034d7ff14 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 25 Jul 1995 04:50:04 +0000 Subject: (main): When too few arguments are given, don't just issue the usage message; also report why. --- src/csplit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/csplit.c b/src/csplit.c index 9fbf0e35f..6c1b6d2cd 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); -- cgit v1.2.3-70-g09d2