On 08/17/2012 12:36 PM, Jim Meyering wrote: > The first time the safe_text buffer is allocated > it will have to be disjoint from the line.text buffer > and from the buffer into which we're about to fread. > Thereafter, regardless of reallocation, overlap should > always be false.
I haven't thought it through entirely, but I was worried about the case where there is a saved line but no saved_text, the buffer is reallocated, and then we test for overlap. If the reallocated buffer does not overlap the original buffer, the test for overlap will fail even though the saved line needs to be copied into a new saved_text buffer. I'll stare at the code some more....
