summaryrefslogtreecommitdiffstats
path: root/usr.bin/more
diff options
context:
space:
mode:
authorhoek <hoek@FreeBSD.org>1999-12-28 03:01:20 +0000
committerhoek <hoek@FreeBSD.org>1999-12-28 03:01:20 +0000
commitc96f8e891fe73a35ab2082f6403dd88a66ac0222 (patch)
tree8df35650e103dc184da2c8d554bfaa0680032f5b /usr.bin/more
parent8c2ccb59caf882ac518eda1f570ea731d4466216 (diff)
downloadFreeBSD-src-c96f8e891fe73a35ab2082f6403dd88a66ac0222.zip
FreeBSD-src-c96f8e891fe73a35ab2082f6403dd88a66ac0222.tar.gz
Delete dead code and clean comments a little.
Diffstat (limited to 'usr.bin/more')
-rw-r--r--usr.bin/more/ch.c16
-rw-r--r--usr.bin/more/linenum.c7
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)
OpenPOWER on IntegriCloud