X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO%2FHandle%2FText.hs;h=cf2541f65e1072c9723bc507ebdc6004e17c20d4;hb=ed8788054ed764f873d43a88fd3ea4ab74373dc1;hp=ebb29c8545bc7c53616ab6597c6e943dbc1e9405;hpb=9edd0b0bc4aea54fe54d7d36923e828e610c013c;p=ghc-base.git diff --git a/GHC/IO/Handle/Text.hs b/GHC/IO/Handle/Text.hs index ebb29c8..cf2541f 100644 --- a/GHC/IO/Handle/Text.hs +++ b/GHC/IO/Handle/Text.hs @@ -861,7 +861,7 @@ bufReadEmpty h_@Handle__{..} bufReadNonEmpty h_ buf' ptr so_far count where loop :: FD -> Int -> Int -> IO Int - loop fd off bytes | bytes <= 0 = return off + loop fd off bytes | bytes <= 0 = return (so_far + off) loop fd off bytes = do r <- RawIO.read (fd::FD) (ptr `plusPtr` off) (fromIntegral bytes) if r == 0