mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
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:
parent
3729010bdd
commit
8cd4e21f0f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98003
@ -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;*/
|
||||
|
Loading…
Reference in New Issue
Block a user