(main): When too few arguments are given, don't just
authorJim Meyering <jim@meyering.net>
Tue, 25 Jul 1995 04:50:04 +0000 (04:50 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 25 Jul 1995 04:50:04 +0000 (04:50 +0000)
issue the usage message; also report why.

src/csplit.c

index 9fbf0e3..6c1b6d2 100644 (file)
@@ -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);