diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-07-24 01:36:13 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-07-24 01:36:13 +1000 |
commit | 7e9f4b138f8a5336bdb7eb1633547932f0d13da5 (patch) | |
tree | 5c4e38aa7bcaab4de039686d590c03a48050fe19 /src | |
parent | 149f946fae07a0e874d5f054323f4305b8fa7028 (diff) |
Ensured putc instruction will properly close file handles
Diffstat (limited to 'src')
-rw-r--r-- | src/Grasp/Interpreter.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Grasp/Interpreter.hs b/src/Grasp/Interpreter.hs index 969c848..0ea7a57 100644 --- a/src/Grasp/Interpreter.hs +++ b/src/Grasp/Interpreter.hs @@ -3,6 +3,7 @@ module Grasp.Interpreter ( ) where +import Control.Monad import System.Random import System.IO import Text.Read( readMaybe ) @@ -338,6 +339,7 @@ putcI g node = do " may only have one file handle") hPutChar fh c + when (fh /= stdout) (hClose fh) return g |