From: simonmar Date: Wed, 14 Jun 2000 10:08:47 +0000 (+0000) Subject: [project @ 2000-06-14 10:08:47 by simonmar] X-Git-Tag: Approximately_9120_patches~4207 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=52ffbe357df896fe7b68cfe3da659df1cfa1e9e5;p=ghc-hetmet.git [project @ 2000-06-14 10:08:47 by simonmar] Fix mondo bogosity in hGetLine, probably caused by cut-n-pasting with eyes shut. --- diff --git a/ghc/lib/std/PrelIO.lhs b/ghc/lib/std/PrelIO.lhs index dc56a7e..f500692 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