SCCS-vsn: bin/stty/stty.c 5.25
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)stty.c 5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)stty.c 5.25 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
ctl = STDIN_FILENO;
fmt = NOTSET;
opterr = 0;
ctl = STDIN_FILENO;
fmt = NOTSET;
opterr = 0;
- while ((ch = getopt(argc, argv, "aef:g")) != EOF)
+ while (strspn(argv[optind], "-aefg") == strlen(argv[optind]) &&
+ (ch = getopt(argc, argv, "aef:g")) != EOF)
switch(ch) {
case 'a': /* undocumented: POSIX compatibility */
fmt = POSIX;
switch(ch) {
case 'a': /* undocumented: POSIX compatibility */
fmt = POSIX;
break;
case 'f':
if ((ctl = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
break;
case 'f':
if ((ctl = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
+ err("%s: %s", optarg, strerror(errno));
break;
case 'g':
fmt = GFLAG;
break;
case 'g':
fmt = GFLAG;