From 968007937c3e108150a109c12163bbeff978629a Mon Sep 17 00:00:00 2001 From: treeowl Date: Thu, 9 Oct 2014 20:07:36 -0400 Subject: 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. --- haddock-api/src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'haddock-api') 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" -- cgit v1.2.3