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.
This commit is contained in:
Tim J. Robbins 2002-06-07 07:08:06 +00:00
parent 3729010bdd
commit 8cd4e21f0f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98003

View File

@ -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;*/