Subject: kern/36306: Console driver outputs \n\r sequence at end-of-line
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <candy-netbsd@kgc.co.jp>
List: netbsd-bugs
Date: 05/11/2007 13:55:01
>Number:         36306
>Category:       kern
>Synopsis:       Console driver outputs \n\r sequence at end-of-line
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 11 13:55:00 +0000 2007
>Originator:     KANDA Toshihiro
>Release:        any version
>Organization:
-
>Environment:
>Description:
Console driver outputs \n\r sequence at end-of-line.

>How-To-Repeat:
Log serial console output.

# od -c serial-console-log
0000000    C   o   p   y   r   i   g   h   t       (   c   )       1   9
0000020    9   6   ,       1   9   9   7   ,       1   9   9   8   ,    
0000040    1   9   9   9   ,       2   0   0   0   ,       2   0   0   1
0000060    ,       2   0   0   2   ,       2   0   0   3  \n  \r        


>Fix:
/sys/dev/cons.c


--- cons.c.orig Fri May 11 10:07:52 2007
+++ cons.c      Fri May 11 10:08:23 2007
@@ -366,9 +366,9 @@
                return;
 
        if (c) {
-               (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
                if (c == '\n')
                        (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
+               (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
        }
 }