Subject: Re: not getting proper CRLF's in /etc/motd
To: None <current-users@NetBSD.ORG>
From: Charles Hannum <mycroft@deshaw.com>
List: current-users
Date: 10/05/1995 00:56:08
In article <199509211719.UAA23130@teeri.jmp.fi> jmarin@teeri.jmp.fi (Jukka Marin) writes:
This has been present since 0.9a, at least:
It looks like this would have started when getty was changed to use
termios.
When I user logs in via a serial port using a VT100 emulator or similar,
/etc/motd2 is printed with only LF's (CR's are missing). Ie, when the
cursor should move to column #1 of next line, it just moves to the next
line.
I just committed the following change to fix this problem and a few
other related ones:
Index: subr.c
===================================================================
RCS file: /a/cvsroot/src/libexec/getty/subr.c,v
retrieving revision 1.14
retrieving revision 1.16
diff -c -2 -r1.14 -r1.16
*** subr.c 1994/09/05 09:09:51 1.14
--- subr.c 1995/10/05 00:54:45 1.16
***************
*** 34,38 ****
#ifndef lint
/*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/
! static char rcsid[] = "$Id: subr.c,v 1.14 1994/09/05 09:09:51 pk Exp $";
#endif /* not lint */
--- 34,38 ----
#ifndef lint
/*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/
! static char rcsid[] = "$Id: subr.c,v 1.16 1995/10/05 00:54:45 mycroft Exp $";
#endif /* not lint */
***************
*** 275,281 ****
if (NL) {
iflag |= ICRNL;
! oflag |= ONLCR;
}
#ifdef XXX_DELAY
f |= delaybits();
--- 275,289 ----
if (NL) {
iflag |= ICRNL;
! oflag |= ONLCR|OPOST;
! } else {
! iflag &= ~ICRNL;
! oflag &= ~ONLCR;
}
+ if (!HT)
+ oflag |= OXTABS|OPOST;
+ else
+ oflag &= ~OXTABS;
+
#ifdef XXX_DELAY
f |= delaybits();
***************
*** 285,289 ****
if (RW) {
iflag = 0;
! oflag = 0;
BICS(cflag, CSIZE|PARENB|PARODD, CS8);
lflag = 0;
--- 293,297 ----
if (RW) {
iflag = 0;
! oflag &= ~OPOST;
BICS(cflag, CSIZE|PARENB|PARODD, CS8);
lflag = 0;
***************
*** 294,302 ****
}
- if (HT)
- oflag &= ~OXTABS;
- else
- oflag |= OXTABS;
-
if (n == 0)
goto out;
--- 302,305 ----
***************
*** 309,327 ****
--- 312,342 ----
if (CE)
lflag |= ECHOE;
+ else
+ lflag &= ~ECHOE;
if (CK)
lflag |= ECHOKE;
+ else
+ lflag &= ~ECHOKE;
if (PE)
lflag |= ECHOPRT;
+ else
+ lflag &= ~ECHOPRT;
if (EC)
lflag |= ECHO;
+ else
+ lflag &= ~ECHO;
if (XC)
lflag |= ECHOCTL;
+ else
+ lflag &= ~ECHOCTL;
if (DX)
lflag |= IXANY;
+ else
+ lflag &= ~IXANY;
out:
Well, I have made other changes in getty, [...]
Anything else we should know about?