From 61439c4c73dec472fb24142c8e6380be4ced89c1 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 3 May 1991 17:19:51 -0800 Subject: [PATCH] didn't get the argument parsing right; fix stty -tostop SCCS-vsn: bin/stty/stty.c 5.22 --- usr/src/bin/stty/stty.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr/src/bin/stty/stty.c b/usr/src/bin/stty/stty.c index 5c5a4c9c40..a0956316de 100644 --- a/usr/src/bin/stty/stty.c +++ b/usr/src/bin/stty/stty.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)stty.c 5.21 (Berkeley) %G%"; +static char sccsid[] = "@(#)stty.c 5.22 (Berkeley) %G%"; #endif /* not lint */ #include @@ -35,7 +35,7 @@ main(argc, argv) char **argv; { extern char *optarg; - extern int optind; + extern int opterr, optind; extern struct cchar cchars1[], cchars2[]; extern struct modes cmodes[], imodes[], lmodes[], omodes[]; register struct modes *mp; @@ -47,6 +47,7 @@ main(argc, argv) ctl = STDIN_FILENO; fmt = NOTSET; + opterr = 0; while ((ch = getopt(argc, argv, "aef:g")) != EOF) switch(ch) { case 'a': /* undocumented: POSIX compatibility */ @@ -63,9 +64,7 @@ main(argc, argv) fmt = GFLAG; break; case '?': - usage(); default: - --optind; goto args; } -- 2.20.1