@@ -37,7 +37,8 @@ import System.IO.Error
38#ifdef FREESTANDING
38#ifdef FREESTANDING
39import Tools_idris
39import Tools_idris
40+import Data.List (intercalate)
40−import System.FilePath (isAbsolute, dropFileName)
41+import System.FilePath (isAbsolute, dropFileName, searchPathSeparator)
41import System.Directory (doesDirectoryExist)
42import System.Directory (doesDirectoryExist)
42import System.Environment (getEnv, setEnv, getExecutablePath)
43import System.Environment (getEnv, setEnv, getExecutablePath)
@@ -109,11 +110,10 @@ setupBundledCC = when hasBundledToolchain
109 if absolute
110 if absolute
110 then tcDir
111 then tcDir
111 else dropFileName exePath ++ tcDir
112 else dropFileName exePath ++ tcDir
112− let pathSep = if isWindows then ";" else ":"
113 present <- doesDirectoryExist target
113 present <- doesDirectoryExist target
114− when present
114+ when present $ do
115− $ do newPath <- return $ target ++ pathSep ++ path
115+ newPath <- return $ intercalate [searchPathSeparator] [target, path]
116− setEnv "PATH" newPath
116+ setEnv "PATH" newPath
118setupBundledCC = return ()
118setupBundledCC = return ()