aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authortreeowl <David.Feuer@gmail.com>2014-10-09 20:07:36 -0400
committertreeowl <David.Feuer@gmail.com>2014-10-09 20:07:36 -0400
commit968007937c3e108150a109c12163bbeff978629a (patch)
tree2c6a2a7f99cb25552910896cea424d2d33e89570 /haddock-api
parentacbc217bf9d505305c8fd424d52c9359fc07269d (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')
-rw-r--r--haddock-api/src/Haddock.hs2
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"