Remove documentation of CRLF bug from more.1. Sync code with manpage.

PR:		bin/961 bin/7296 (fix)
Submitted by:	Garance Alistair Drosehn <gad@eclipse.acs.rpi.edu>
This commit is contained in:
Tim Vanderhoek 1999-04-29 18:03:38 +00:00
parent d74efe9105
commit d75db65f59
3 changed files with 18 additions and 26 deletions

View file

@ -101,7 +101,6 @@ static off_t last_piped_pos;
static
fch_get()
{
extern int bs_mode;
register struct buf *bp;
register int n, ch;
register char *p, *t;
@ -187,28 +186,10 @@ read_more:
bp->data[bp->datasize++] = EOI;
}
if (bs_mode) {
for (p = &bp->data[bp->datasize]; --n >= 0;) {
*--p;
if (*p == EOI)
*p = 0200;
}
}
else {
for (t = p; --n >= 0; ++p) {
ch = *p;
if (ch == '\r' && n && p[1] == '\n') {
++p;
*t++ = '\n';
}
else
*t++ = (ch == EOI) ? 0200 : ch;
}
if (p != t) {
bp->datasize -= p - t;
if (ispipe)
last_piped_pos -= p - t;
}
for (p = &bp->data[bp->datasize]; --n >= 0;) {
*--p;
if (*p == EOI)
*p = 0200;
}
found:

View file

@ -122,7 +122,7 @@ adjacent to an underscore character are displayed as underlined text.
Backspaces which appear between two identical characters are displayed
as emboldened text.
.Dv CR-LF
sequences are compressed to a single linefeed
sequences are compressed to a single newline
character. The
.Fl u
option causes backspaces to always be displayed as
@ -289,8 +289,7 @@ characteristics necessary to manipulate the screen.
.Xr ctags 1 ,
.Xr vi 1
.Sh BUGS
Incorrect output can result from omitting the -u flag when accessing regular
files with CRLF line termination.
Reading files with long lines is slow.
.Sh AUTHORS
This software is derived from software contributed to Berkeley
by

View file

@ -47,6 +47,7 @@ static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 6/6/93";
int errmsgs; /* Count of messages displayed by error() */
extern int bs_mode;
extern int sigs;
extern int sc_width, sc_height;
extern int ul_width, ue_width;
@ -116,6 +117,17 @@ put_line()
putbs();
column--;
break;
case '\r':
/* treat \r\n sequences like \n if -u flag not set. */
if (bs_mode || p[1] != '\0')
{
/* -u was set, or this CR is not a CRLF, so
* treat this CR like any other control_char */
putchr('^');;
putchr(CARAT_CHAR(c));
column += 2;
}
break;
default:
if (c == 0200 || CONTROL_CHAR(c))
{