Subject: not getting proper CRLF's in /etc/motd
To: Current Users <current-users@NetBSD.ORG>
From: Jukka Marin <jmarin@teeri.jmp.fi>
List: current-users
Date: 09/21/1995 20:19:29
This has been present since 0.9a, at least:

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.

The same happens if you give an incorrect login/passwd and login(1)
prompts for another pair of login/passwd.  Everything printed by login(1)
lacks a CR to return the cursor to column 1.

Note that these problems are _not_ present when using network login.

I tried to set the nl flag in /etc/gettytab but it didn't help.  I looked
into ..getty/subr.c and noticed that when setting the ONLCR flag the OPOST
flag is not set.  It seems that this flag must be set for the other output
flags to have any effect.

I added the OPOST flag to getty/subr.c in two places:

        if (NL) {
                iflag |= ICRNL;
                oflag |= ONLCR|OPOST;
        }

...

        if (HT)
                oflag &= ~OXTABS;
        else
                oflag |= OXTABS|OPOST;


Doing this and setting the nl flag in /etc/gettytab, CR/LF now works
properly during login.  Well, I have made other changes in getty, so
I'm not 100% sure if this is enough, but as it was, the NL flag had
no effect at all, so there must be something wrong in there... ;-)

My getty also has a new option 'mo' to set a modem init string before
doing the usual getty stuff.

  -jm

-- 

                     ---> http://www.jmp.fi/~jmarin/ <---