From: tholo Date: Tue, 17 Dec 1996 19:33:53 +0000 (+0000) Subject: Add traditional handling of all upper-case input X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8f901b87201a8d500dc8daa6725a95eb9bd81559;p=openbsd Add traditional handling of all upper-case input --- diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 44b2b942c1e..67904bda83a 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -39,7 +39,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93";*/ -static char rcsid[] = "$Id: main.c,v 1.5 1996/12/10 07:58:34 deraadt Exp $"; +static char rcsid[] = "$Id: main.c,v 1.6 1996/12/17 19:33:53 tholo Exp $"; #endif /* not lint */ #include @@ -316,12 +316,16 @@ main(argc, argv) tmode.c_iflag |= ICRNL; tmode.c_oflag |= ONLCR; } -#if XXX - if (upper || UC) - tmode.sg_flags |= LCASE; - if (lower || LC) - tmode.sg_flags &= ~LCASE; -#endif + if (upper || UC) { + tmode.c_iflag |= IUCLC; + tmode.c_oflag |= OLCUC; + tmode.c_lflag |= XCASE; + } + if (lower || LC) { + tmode.c_iflag &= ~IUCLC; + tmode.c_oflag &= ~OLCUC; + tmode.c_lflag &= ~XCASE; + } if (tcsetattr(0, TCSANOW, &tmode) < 0) { syslog(LOG_ERR, "%s: %m", ttyn); exit(1); diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 14ed2aa2079..4c7c36499a0 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/ -static char rcsid[] = "$Id: subr.c,v 1.6 1996/12/16 20:04:45 tholo Exp $"; +static char rcsid[] = "$Id: subr.c,v 1.7 1996/12/17 19:33:55 tholo Exp $"; #endif /* not lint */ /* @@ -264,10 +264,11 @@ setflags(n) } } /* else, leave as is */ -#if 0 - if (UC) - f |= LCASE; -#endif + if (UC) { + SET(iflag, IUCLC); + SET(oflag, OLCUC); + SET(lflag, XCASE); + } if (HC) SET(cflag, HUPCL); @@ -388,7 +389,7 @@ register long flags; SET(oflag, OXTABS); else CLR(oflag, OXTABS); - if (ISSET(flags, LCASE)) + if (ISSET(flags, LCASE)) { SET(iflag, IUCLC); SET(oflag, OLCUC); SET(lflag, XCASE);