on master help sign in
Open files in binary mode
51a9b69David Raymond Christiansen
src/Idris/Core/Execute.hs+3−1
@@ -265,7 +265,9 @@ execApp env ctxt (EP _ fp _) (_:fn:fileStr:modeStr:rest)
265 "r+" -> Right ReadWriteMode
265 "r+" -> Right ReadWriteMode
266 _ -> Left ("Invalid mode for " ++ f ++ ": " ++ mode)
266 _ -> Left ("Invalid mode for " ++ f ++ ": " ++ mode)
267 case fmap (openFile f) m of
267 case fmap (openFile f) m of
268+ Right h -> do h' <- h
269+ hSetBinaryMode h' True
268− Right h -> do h' <- h; return $ Right (ioWrap (EHandle h'), tail rest)
270+ return $ Right (ioWrap (EHandle h'), tail rest)
269 Left err -> return $ Left err)
271 Left err -> return $ Left err)
270 (\e -> let _ = ( e::SomeException)
272 (\e -> let _ = ( e::SomeException)
271 in return $ Right (ioWrap (EPtr nullPtr), tail rest))
273 in return $ Right (ioWrap (EPtr nullPtr), tail rest))