summaryrefslogtreecommitdiff
path: root/libexec/getty
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-12-16 20:04:57 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-12-16 20:04:57 +0000
commit5a09a67a00e664c638ec75e42527b7be43e106e9 (patch)
treebdbaf1bcb1add1dcbe2614ec0bcd2eb2d63324dd /libexec/getty
parent296c12c4b0ff928c16b41811ddd1edaddfb093e1 (diff)
Implement more tty flags for better portability from other systems:
XCASE - canonical input/output processing IUCLC - translate uppercase to lowercase on input OLCUC - translate lowercase to uppercase on output OCRNL - translate carriage return to newline on output ONOCR - do not output carriage return at column 0 ONLRET - newline performs carriage return function In addition the tty compatibility interface supports LCASE properly. Look at termios(4) for a more complete description of the above flags.
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/subr.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c
index f2c8dc5c0e7..14ed2aa2079 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.5 1996/12/16 17:14:03 deraadt Exp $";
+static char rcsid[] = "$Id: subr.c,v 1.6 1996/12/16 20:04:45 tholo Exp $";
#endif /* not lint */
/*
@@ -388,15 +388,27 @@ register long flags;
SET(oflag, OXTABS);
else
CLR(oflag, OXTABS);
+ if (ISSET(flags, LCASE))
+ SET(iflag, IUCLC);
+ SET(oflag, OLCUC);
+ SET(lflag, XCASE);
+ }
+ else {
+ CLR(iflag, IUCLC);
+ CLR(oflag, OLCUC);
+ CLR(lflag, XCASE);
+ }
if (ISSET(flags, RAW)) {
iflag &= IXOFF;
- CLR(lflag, ISIG|ICANON|IEXTEN);
+ CLR(lflag, ISIG|ICANON|IEXTEN|XCASE);
CLR(cflag, PARENB);
} else {
SET(iflag, BRKINT|IXON|IMAXBEL);
SET(lflag, ISIG|IEXTEN);
+ if (ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC))
+ SET(lflag, XCASE);
if (ISSET(flags, CBREAK))
CLR(lflag, ICANON);
else