From f81a309eb1a96e6161c6bef59e397cc95aca6a7b Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 24 Jun 2009 12:07:38 +0000 Subject: [PATCH] bugfix: Use openBinaryFile in Data.Binary.decodeFile. It makes difference only on Windows --- src/Data/Binary.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Binary.hs b/src/Data/Binary.hs index a0a0bc702..86353e143 100644 --- a/src/Data/Binary.hs +++ b/src/Data/Binary.hs @@ -271,7 +271,7 @@ encodeFile f v = L.writeFile f (encode v) -- or otherwise finalise the resource. -- decodeFile :: Binary a => FilePath -> IO a -decodeFile f = bracket (openFile f ReadMode) hClose $ \h -> do +decodeFile f = bracket (openBinaryFile f ReadMode) hClose $ \h -> do s <- L.hGetContents h evaluate $ runGet (do v <- get m <- isEmpty