on master help sign in
Merge pull request #3409 from steshaw/use-search-path-separator

Use System.FilePath.searchPathSeparator for $PATH

commit8b659b7862beb497e770683e81a5ee3611d33fbc authorNiklas Larsson <metaniklas@gmail.com> dateWed 7 Sep 2016, 19:44 (10 years ago) parent16b0fe8166760f
1 file changed+5−5
src/Util/System.hs+5−5
src/Util/System.hs+5−5
@@ -37,7 +37,8 @@ import System.IO.Error
3737
3838#ifdef FREESTANDING
3939import Tools_idris
40−import System.FilePath (isAbsolute, dropFileName)
40+import Data.List (intercalate)
41+import System.FilePath (isAbsolute, dropFileName, searchPathSeparator)
4142import System.Directory (doesDirectoryExist)
4243import System.Environment (getEnv, setEnv, getExecutablePath)
4344#endif
@@ -109,11 +110,10 @@ setupBundledCC = when hasBundledToolchain
109110 if absolute
110111 then tcDir
111112 else dropFileName exePath ++ tcDir
112− let pathSep = if isWindows then ";" else ":"
113113 present <- doesDirectoryExist target
114− when present
115− $ do newPath <- return $ target ++ pathSep ++ path
116− setEnv "PATH" newPath
114+ when present $ do
115+ newPath <- return $ intercalate [searchPathSeparator] [target, path]
116+ setEnv "PATH" newPath
117117#else
118118setupBundledCC = return ()
119119#endif