diff options
author | hoek <hoek@FreeBSD.org> | 1999-12-28 03:01:20 +0000 |
---|---|---|
committer | hoek <hoek@FreeBSD.org> | 1999-12-28 03:01:20 +0000 |
commit | c96f8e891fe73a35ab2082f6403dd88a66ac0222 (patch) | |
tree | 8df35650e103dc184da2c8d554bfaa0680032f5b | |
parent | 8c2ccb59caf882ac518eda1f570ea731d4466216 (diff) | |
download | FreeBSD-src-c96f8e891fe73a35ab2082f6403dd88a66ac0222.zip FreeBSD-src-c96f8e891fe73a35ab2082f6403dd88a66ac0222.tar.gz |
Delete dead code and clean comments a little.
-rw-r--r-- | usr.bin/more/ch.c | 16 | ||||
-rw-r--r-- | usr.bin/more/linenum.c | 7 |
2 files changed, 15 insertions, 8 deletions
diff --git a/usr.bin/more/ch.c b/usr.bin/more/ch.c index 6dccea7..711bac8 100644 --- a/usr.bin/more/ch.c +++ b/usr.bin/more/ch.c @@ -36,6 +36,11 @@ static char sccsid[] = "@(#)ch.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + /* * Low level character input from the input file. * We use these special purpose routines which optimize moving @@ -172,22 +177,17 @@ read_more: if (ispipe) last_piped_pos += n; - p = &bp->data[bp->datasize]; bp->datasize += n; - /* - * Set an EOI marker in the buffered data itself. Then ensure the - * data is "clean": there are no extra EOI chars in the data and - * that the "meta" bit (the 0200 bit) is reset in each char; - * also translate \r\n sequences to \n if -u flag not set. - */ if (n == 0) { ch_fsize = pos; bp->data[bp->datasize++] = EOI; } + /* + * Turn EOI (nul) characters into 0200 since EOI has special meaning. */ for (p = &bp->data[bp->datasize]; --n >= 0;) { - *--p; + --p; if (*p == EOI) *p = 0200; } diff --git a/usr.bin/more/linenum.c b/usr.bin/more/linenum.c index c0d2816..84fa04b 100644 --- a/usr.bin/more/linenum.c +++ b/usr.bin/more/linenum.c @@ -222,6 +222,13 @@ add_lnum(line, pos) * we get to p->next == &anchor. This also avoids * looking at the gap of the last one, which is * not computed by calcgap. + * + * XXX Should also ensure that we can determine the line + * number in the case where we are reading from a pipe + * and we no longer have the first block(s) of data from + * the pipe buffered in ch.c. Further, keeping linenum + * entries for lines in this case that have been thrown- + * out of the buffer is fairly pointless. */ mingap = anchor.next->gap; for (p = anchor.next; p->next != &anchor; p = p->next) |