From 52ffbe357df896fe7b68cfe3da659df1cfa1e9e5 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 14 Jun 2000 10:08:47 +0000 Subject: [PATCH] [project @ 2000-06-14 10:08:47 by simonmar] Fix mondo bogosity in hGetLine, probably caused by cut-n-pasting with eyes shut. --- ghc/lib/std/PrelIO.lhs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 1.7.10.4