diff options
author | treeowl <David.Feuer@gmail.com> | 2014-10-09 20:07:36 -0400 |
---|---|---|
committer | treeowl <David.Feuer@gmail.com> | 2014-10-09 20:07:36 -0400 |
commit | 968007937c3e108150a109c12163bbeff978629a (patch) | |
tree | 2c6a2a7f99cb25552910896cea424d2d33e89570 /haddock-api/src/Haddock.hs | |
parent | acbc217bf9d505305c8fd424d52c9359fc07269d (diff) |
Fix improper lazy IO use
Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results.
Diffstat (limited to 'haddock-api/src/Haddock.hs')
-rw-r--r-- | haddock-api/src/Haddock.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 0cff5bd3..631f813b 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -456,7 +456,7 @@ getPrologue dflags flags = [filename] -> withFile filename ReadMode $ \h -> do hSetEncoding h utf8 str <- hGetContents h - return . Just $ parseParas dflags str + return . Just $! parseParas dflags str _ -> throwE "multiple -p/--prologue options" |