on master help sign in
Fix the hGetContents crash test
c051a63Bryan O'Sullivan
Data/Text/IO.hs+1−1
@@ -102,9 +102,9 @@ hGetContents h = do
102 (hh',ts) <- readChunks
102 (hh',ts) <- readChunks
103 return (hh', t:ts)
103 return (hh', t:ts)
104 readChunks `catch` \e -> do
104 readChunks `catch` \e -> do
105− (hh', _) <- hClose_help hh
106 if isEOFError e
105 if isEOFError e
107 then do
106 then do
107+ (hh', _) <- hClose_help hh
108 buf <- readIORef haCharBuffer
108 buf <- readIORef haCharBuffer
109 return $ if isEmptyBuffer buf
109 return $ if isEmptyBuffer buf
110 then (hh', [])
110 then (hh', [])