On 14 September 2006 17:59, Volker Quetschke wrote: > Hi!
> (snip) >> +#ifdef __CYGWIN__ >> + /* lseek'ing on text files is problematic; lseek reports the true >> + file offset, but read collapses \r\n and returns a character >> + count. We cannot reliably seek backwards if nr is smaller than >> + the seek offset encountered during the read, and must instead >> + treat the stream as unbuffered. */ >> + if ((bp->b_flag & (B_TEXT | B_UNBUFF)) == B_TEXT) > ------------------------^^^^^^^^^^^^^^^^^ ^^^^^^ > part of the patch looks suspicious to me. You probably just want to test > if the LHS expression is true. You reckon? That looks to me like a test for B_TEXT is set *and* B_UNBUFF is cleared. Since the action we're going to take if this test succeeds is to set the stream unbuffered, there's no need to do it for a stream that already /is/ unbuffered. That's how it looks to me at first glance, anyway. I agree it's a /slightly/ unclear construct that should /perhaps/ have an explicit comment to clarify the way in which it's been worded. > Volker > >> + { >> + off_t offset = lseek (bp->b_fd, 0, SEEK_CUR); ... Could have made good use of another one of your "(snip)"s here...! [ ... snip ... ] cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/