diff options
| author | Assar Westerlund <assar@FreeBSD.org> | 2001-03-04 06:04:50 +0000 | 
|---|---|---|
| committer | Assar Westerlund <assar@FreeBSD.org> | 2001-03-04 06:04:50 +0000 | 
| commit | 3617ddfc33101e0c75cac231ca0c335f8182fa99 (patch) | |
| tree | 974aa105eebe6179c2de9c7be9049ff272a43e4f /sys/kern/tty.c | |
| parent | 2600f312d75bcee1656640f5b6062ec35d5abb3c (diff) | |
Notes
Diffstat (limited to 'sys/kern/tty.c')
| -rw-r--r-- | sys/kern/tty.c | 12 | 
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 1bc30caad0cf..a7ba12dec90e 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -667,9 +667,16 @@ ttyoutput(c, tp)  	if (c == '\n' && ISSET(tp->t_oflag, ONLCR)) {  		tk_nout++;  		tp->t_outcc++; -		if (putc('\r', &tp->t_outq)) +		if (!ISSET(tp->t_lflag, FLUSHO) && putc('\r', &tp->t_outq))  			return (c);  	} +	/* If OCRNL is set, translate "\r" into "\n". */ +	else if (c == '\r' && ISSET(tp->t_oflag, OCRNL)) +		c = '\n'; +	/* If ONOCR is set, don't transmit CRs when on column 0. */ +	else if (c == '\r' && ISSET(tp->t_oflag, ONOCR) && tp->t_column == 0) +		return (-1); +  	tk_nout++;  	tp->t_outcc++;  	if (!ISSET(tp->t_lflag, FLUSHO) && putc(c, &tp->t_outq)) @@ -684,6 +691,9 @@ ttyoutput(c, tp)  	case CONTROL:  		break;  	case NEWLINE: +		if (ISSET(tp->t_oflag, ONLCR | ONLRET)) +			col = 0; +		break;  	case RETURN:  		col = 0;  		break;  | 
