summaryrefslogtreecommitdiff
path: root/src/Grasp/Interpreter.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Grasp/Interpreter.hs')
-rw-r--r--src/Grasp/Interpreter.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Grasp/Interpreter.hs b/src/Grasp/Interpreter.hs
index 1203da2..14de9bc 100644
--- a/src/Grasp/Interpreter.hs
+++ b/src/Grasp/Interpreter.hs
@@ -407,7 +407,9 @@ getcI = do
Monad.when (length fhNodes > 1) (error "Instruction getc should have at most one fh argument")
let fh = IN.toString . GN.toInst $ head fhNodes
- handle <- if (length fhNodes == 0) then return IO.stdin else GMonad.getReadHandle fh
+ handle <- if (length fhNodes == 0)
+ then liftIO (IO.hSetBuffering IO.stdin IO.NoBuffering) >> return IO.stdin
+ else GMonad.getReadHandle fh
c <- liftIO (IO.hGetChar handle)
let result = if (c == '\EOT') then -1 else Char.ord c