Bruno Haible wrote: > Jim Meyering wrote: >> ... it no longer applies due to changes in dfasearch.c. >> >> Would you please update the patch? > > Here is the update. It passes "make check". > > > 2010-08-17 Bruno Haible <[email protected]> > > EGexecute: Don't assume the buffer ends in a newline. > * src/dfasearch.c (EGexecute): Don't ignore the last byte of the buffer > if it is not a newline.
Hi Bruno and Paolo, Thanks for your patience. That change looks good and safe to me. Paolo's concern about BEST_MATCH being *two* past end of buffer is valid, but I've convinced myself that even if there is a malloc implementation that returns a buffer whose final byte is in the last available page, we'd be ok. That is because of the way the buffer size is chosen: adding page size + 1 ensures that an address 1 or 2 beyond end of buffer will refer to the same page as the last byte. Bruno, do you have a test case that fails without this patch? If not, it'd be great if you could cook one up so we can add it to the test suite. If this is a regression, I'll have to identify the point at which it occurred. Finally, this deserves an entry in NEWS.
