diff options
| author | simonmar <unknown> | 2000-06-14 10:08:47 +0000 |
|---|---|---|
| committer | simonmar <unknown> | 2000-06-14 10:08:47 +0000 |
| commit | 52ffbe357df896fe7b68cfe3da659df1cfa1e9e5 (patch) | |
| tree | b01c9627a873b1d306fc21aa4cc6970b1c2fb0e4 /ghc/lib | |
| parent | 9a8262864dc58a346f73af333855da39c5804c93 (diff) | |
| download | haskell-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/lib')
| -rw-r--r-- | ghc/lib/std/PrelIO.lhs | 10 |
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 |
