Add traditional handling of all upper-case input
authortholo <tholo@openbsd.org>
Tue, 17 Dec 1996 19:33:53 +0000 (19:33 +0000)
committertholo <tholo@openbsd.org>
Tue, 17 Dec 1996 19:33:53 +0000 (19:33 +0000)
libexec/getty/main.c
libexec/getty/subr.c

index 44b2b94..67904bd 100644 (file)
@@ -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 <sys/param.h>
@@ -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);
index 14ed2aa..4c7c364 100644 (file)
@@ -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);