projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-01-14 11:46:24 by simonmar]
[ghc-hetmet.git]
/
ghc
/
compiler
/
utils
/
StringBuffer.lhs
diff --git
a/ghc/compiler/utils/StringBuffer.lhs
b/ghc/compiler/utils/StringBuffer.lhs
index
61a0321
..
a8c7a1e
100644
(file)
--- a/
ghc/compiler/utils/StringBuffer.lhs
+++ b/
ghc/compiler/utils/StringBuffer.lhs
@@
-49,7
+49,8
@@
import GHC.IOBase
import GHC.IO ( slurpFile )
#endif
import GHC.IO ( slurpFile )
#endif
-import IO ( openFile, hFileSize, IOMode(ReadMode) )
+import IO ( openFile, hFileSize, IOMode(ReadMode),
+ hClose )
#if __GLASGOW_HASKELL__ >= 601
import System.IO ( openBinaryFile )
#else
#if __GLASGOW_HASKELL__ >= 601
import System.IO ( openBinaryFile )
#else
@@
-103,6
+104,7
@@
hGetStringBuffer fname = do
arr <- newArray_ (0,size_i-1)
r <- if size_i == 0 then return 0 else hGetArray h arr size_i
#endif
arr <- newArray_ (0,size_i-1)
r <- if size_i == 0 then return 0 else hGetArray h arr size_i
#endif
+ hClose h
if (r /= size_i)
then ioError (userError "short read of file")
else do
if (r /= size_i)
then ioError (userError "short read of file")
else do