Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
jberryman
GHC
Commits
fb970193
Commit
fb970193
authored
Jun 15, 2009
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copyFileWithHeader: use binary Handles
Fixes failure when Haddocking Data.Monoid in libraries/base
parent
20633c5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
compiler/main/SysTools.lhs
compiler/main/SysTools.lhs
+7
-6
No files found.
compiler/main/SysTools.lhs
View file @
fb970193
...
...
@@ -420,12 +420,13 @@ copyWithHeader :: DynFlags -> String -> Maybe String -> FilePath -> FilePath
copyWithHeader dflags purpose maybe_header from to = do
showPass dflags purpose
h <- openFile to WriteMode
ls <- readFile from -- inefficient, but it'll do for now.
-- ToDo: speed up via slurping.
maybe (return ()) (hPutStr h) maybe_header
hPutStr h ls
hClose h
hout <- openBinaryFile to WriteMode
hin <- openBinaryFile from ReadMode
ls <- hGetContents hin -- inefficient, but it'll do for now. ToDo: speed up
maybe (return ()) (hPutStr hout) maybe_header
hPutStr hout ls
hClose hout
hClose hin
getExtraViaCOpts :: DynFlags -> IO [String]
getExtraViaCOpts dflags = do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment