Fix a subtle laziness bug - thanks, QuickCheck!
We were streaming data out of the character buffer too late, so every
chunk we returned contained the same contents, namely whatever happened
to be in the last chunk we consumed while reading a line.
--HG--
extra : convert_revision : 3a724de236d47b0b125ce535a54fce9ba28e7dd2
commitb83e6b7354d6d5828bb5dc5e6c99ee65ef0f138c
authorBryan O'Sullivan <bos@serpentine.com>
dateSun 29 Aug 2010, 16:50 (16 years ago)
parent84f05d0
Data/Text/IO/Internal.hs+1−1
@@ -105,7 +105,7 @@ unpack_nl !buf !r !w
105105 | otherwise = withRawBuffer buf $ go
106106 where
107107 go pbuf = do
108− let t = unstream (Stream next r (maxSize (w-r)))
108+ let !t = unstream (Stream next r (maxSize (w-r)))
109109 w' = w - 1
110110 return $ if ix w' == '\r'
111111 then (t,w')