From 8cd4e21f0fdbba356311ccbd50444fed6a89d8fd Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 7 Jun 2002 07:08:06 +0000 Subject: [PATCH] Contrary to what the comments said, rs -H did not recycle storage, it just kept writing past the end of the buffer. Correct the code so that it actually does recycle storage. --- usr.bin/rs/rs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c index a1c50c36d940..36d7c312c5be 100644 --- a/usr.bin/rs/rs.c +++ b/usr.bin/rs/rs.c @@ -347,8 +347,10 @@ getline(void) /* get line; maintain curline, curlen; manage storage */ } else if (skip <= 0) { /* don't waste storage */ curline += curlen + 1; - if (putlength) /* print length, recycle storage */ + if (putlength) { /* print length, recycle storage */ printf(" %d line %d\n", curlen, irows); + curline = ibuf; + } } if (!putlength && endblock - curline < BUFSIZ) { /* need storage */ /*ww = endblock-curline; tt += ww;*/