mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
Back out my minorly disputed and possibly not well thought out changes to how
arguments are processed, at least temporarily.
This commit is contained in:
parent
6bd521df93
commit
f201bc9c84
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99221
1 changed files with 7 additions and 7 deletions
|
|
@ -83,12 +83,11 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct openfile *ip;
|
||||
|
||||
if (argc > MAXOFILES)
|
||||
errx(1, "too many input files");
|
||||
else if (argc == 1)
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
getargs(argv);
|
||||
if (!morefiles)
|
||||
usage();
|
||||
for (;;) {
|
||||
linep = line;
|
||||
for (ip = input; ip->fp != NULL; ip++)
|
||||
|
|
@ -114,10 +113,11 @@ getargs(char *av[])
|
|||
P = S = F = T = 0; /* capitalized options */
|
||||
while ((p = *++av) != NULL) {
|
||||
if (*p != '-' || !p[1]) {
|
||||
morefiles++;
|
||||
if (*p == '-') {
|
||||
if (++morefiles >= MAXOFILES)
|
||||
errx(1, "too many input files");
|
||||
if (*p == '-')
|
||||
ip->fp = stdin;
|
||||
} else if ((ip->fp = fopen(p, "r")) == NULL) {
|
||||
else if ((ip->fp = fopen(p, "r")) == NULL) {
|
||||
err(1, "%s", p);
|
||||
}
|
||||
ip->pad = P;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue