shithub: MicroHs

Download patch

ref: b047dd65e0c62c2c6a8b019715aa5cff6fa39f7f
parent: 7ee99c3f824aa8d3e7ac14d36fcc423c75e89aad
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Mon Nov 13 08:28:16 EST 2023

Don't double close.

--- a/src/MicroHs/Main.hs
+++ b/src/MicroHs/Main.hs
@@ -91,12 +91,13 @@
       writeFile outFile $ makeCArray outData
      else withSystemTempFile "mhsc.c" $ \ fn h -> do
        hPutStr h $ makeCArray outData
-       hClose h
+       hFlush h
        ct1 <- getTimeMilli
        mdir <- lookupEnv "MHSDIR"
        let mhsdir = fromMaybe "." mdir
        let cmd = "cc -w -Wall -O3 " ++ mhsdir ++ "/src/runtime/eval.c " ++ fn ++ " -lm -o " ++ outFile
-       --print cmd
+       when (verbose flags > 0) $
+         putStrLn $ "Execute: " ++ show cmd
        callCommand cmd
        ct2 <- getTimeMilli
        when (verbose flags > 0) $
--