summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonmar <unknown>2000-06-14 10:08:47 +0000
committersimonmar <unknown>2000-06-14 10:08:47 +0000
commit52ffbe357df896fe7b68cfe3da659df1cfa1e9e5 (patch)
treeb01c9627a873b1d306fc21aa4cc6970b1c2fb0e4 /ghc
parent9a8262864dc58a346f73af333855da39c5804c93 (diff)
downloadhaskell-52ffbe357df896fe7b68cfe3da659df1cfa1e9e5.tar.gz
[project @ 2000-06-14 10:08:47 by simonmar]
Fix mondo bogosity in hGetLine, probably caused by cut-n-pasting with eyes shut.
Diffstat (limited to 'ghc')
-rw-r--r--ghc/lib/std/PrelIO.lhs10
1 files changed, 5 insertions, 5 deletions
diff --git a/ghc/lib/std/PrelIO.lhs b/ghc/lib/std/PrelIO.lhs
index dc56a7e85b..f500692bfa 100644
--- a/ghc/lib/std/PrelIO.lhs
+++ b/ghc/lib/std/PrelIO.lhs
@@ -140,12 +140,12 @@ hGetChar handle = do
hGetLine :: Handle -> IO String
hGetLine h = do
- buffer_mode <- wantWriteableHandle_ "hGetLine" h
- (\ handle_ -> do getBuffer handle_)
+ buffer_mode <- wantReadableHandle "hGetLine" h
+ (\ handle_ -> do return (haBufferMode__ handle_))
case buffer_mode of
- (NoBuffering, _, _) -> hGetLineUnBuffered h
- (LineBuffering, buf, bsz) -> hGetLineBuf' []
- (BlockBuffering _, buf, bsz) -> hGetLineBuf' []
+ NoBuffering -> hGetLineUnBuffered h
+ LineBuffering -> hGetLineBuf' []
+ BlockBuffering _ -> hGetLineBuf' []
where hGetLineBuf' xss = do
(eol, xss) <- catch