projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f82c82
)
Close .ghci files after reading them; fixes trac #4487
author
Ian Lynagh
<igloo@earth.li>
Sun, 5 Dec 2010 20:53:01 +0000
(20:53 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sun, 5 Dec 2010 20:53:01 +0000
(20:53 +0000)
ghc/InteractiveUI.hs
patch
|
blob
|
history
diff --git
a/ghc/InteractiveUI.hs
b/ghc/InteractiveUI.hs
index
552b61c
..
80ec79d
100644
(file)
--- a/
ghc/InteractiveUI.hs
+++ b/
ghc/InteractiveUI.hs
@@
-404,8
+404,10
@@
runGHCi paths maybe_exprs = do
-- NOTE: this assumes that runInputT won't affect the terminal;
-- can we assume this will always be the case?
-- This would be a good place for runFileInputT.
-- NOTE: this assumes that runInputT won't affect the terminal;
-- can we assume this will always be the case?
-- This would be a good place for runFileInputT.
- Right hdl -> runInputTWithPrefs defaultPrefs defaultSettings $ do
+ Right hdl ->
+ do runInputTWithPrefs defaultPrefs defaultSettings $
runCommands $ fileLoop hdl
runCommands $ fileLoop hdl
+ liftIO (hClose hdl `IO.catch` \_ -> return ())
where
getDirectory f = case takeDirectory f of "" -> "."; d -> d
where
getDirectory f = case takeDirectory f of "" -> "."; d -> d