summaryrefslogtreecommitdiff
path: root/src/csplit.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-07-25 04:50:04 +0000
committerJim Meyering <jim@meyering.net>1995-07-25 04:50:04 +0000
commit7732d5d7cfd6326e5457953a25ba447034d7ff14 (patch)
tree600956df1bbd497d5fb4cb67e58d0d86af72ca67 /src/csplit.c
parent5f33b7841729c3d080a3d63103007c971fb394eb (diff)
downloadcoreutils-7732d5d7cfd6326e5457953a25ba447034d7ff14.tar.xz
(main): When too few arguments are given, don't just
issue the usage message; also report why.
Diffstat (limited to 'src/csplit.c')
-rw-r--r--src/csplit.c7
1 files changed, 5 insertions, 2 deletions
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);