aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Vanderhoek <hoek@FreeBSD.org>1999-12-28 03:01:20 +0000
committerTim Vanderhoek <hoek@FreeBSD.org>1999-12-28 03:01:20 +0000
commit427db879c9c39266493f3a7f772d0acc584547b4 (patch)
tree312a8757951434fbb7e8edac6938a278752c83c7
parent7d56d3747c94bb6889973c7449a57e83cc943d39 (diff)
downloadsrc-427db879c9c39266493f3a7f772d0acc584547b4.tar.gz
src-427db879c9c39266493f3a7f772d0acc584547b4.zip
Delete dead code and clean comments a little.
Notes
Notes: svn path=/head/; revision=55164
-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 6dccea7d5510..711bac80dcca 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 c0d281664a3f..84fa04b0c097 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)