summaryrefslogtreecommitdiff
path: root/usr.bin/split
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2005-08-30 12:32:18 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2005-08-30 12:32:18 +0000
commitbb78dba49b79cf66f84c863e3c392ba9f9b7f08d (patch)
tree5f4ed626393d4fee4f15485ce364e3b1b6a80dc7 /usr.bin/split
parentf2ba84d72ddf0f4c5ff41ac16496695049905963 (diff)
Notes
Diffstat (limited to 'usr.bin/split')
-rw-r--r--usr.bin/split/split.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index e1978be03f1b..906d07a0ed8d 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -88,7 +88,7 @@ main(int argc, char **argv)
setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "-0123456789a:b:l:p:")) != -1)
+ while ((ch = getopt(argc, argv, "0123456789a:b:l:p:")) != -1)
switch (ch) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
@@ -108,11 +108,6 @@ main(int argc, char **argv)
"%s: illegal line count", optarg);
}
break;
- case '-': /* Undocumented: historic stdin flag. */
- if (ifd != -1)
- usage();
- ifd = 0;
- break;
case 'a': /* Suffix length */
if ((sufflen = strtol(optarg, &ep, 10)) <= 0 || *ep)
errx(EX_USAGE,
@@ -153,14 +148,13 @@ main(int argc, char **argv)
argv += optind;
argc -= optind;
- if (*argv != NULL)
- if (ifd == -1) { /* Input file. */
- if (strcmp(*argv, "-") == 0)
- ifd = STDIN_FILENO;
- else if ((ifd = open(*argv, O_RDONLY, 0)) < 0)
- err(EX_NOINPUT, "%s", *argv);
- ++argv;
- }
+ if (*argv != NULL) { /* Input file. */
+ if (strcmp(*argv, "-") == 0)
+ ifd = STDIN_FILENO;
+ else if ((ifd = open(*argv, O_RDONLY, 0)) < 0)
+ err(EX_NOINPUT, "%s", *argv);
+ ++argv;
+ }
if (*argv != NULL) /* File name prefix. */
if (strlcpy(fname, *argv++, sizeof(fname)) >= sizeof(fname))
errx(EX_USAGE, "file name prefix is too long");