projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
9edd0b0
)
hGetBuf: fix a case of a short read being returned (#4427)
author
Simon Marlow
<marlowsd@gmail.com>
Wed, 27 Oct 2010 14:43:24 +0000
(14:43 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Wed, 27 Oct 2010 14:43:24 +0000
(14:43 +0000)
GHC/IO/Handle/Text.hs
patch
|
blob
|
history
diff --git
a/GHC/IO/Handle/Text.hs
b/GHC/IO/Handle/Text.hs
index
ebb29c8
..
cf2541f
100644
(file)
--- 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