X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverState.hs;fp=ghc%2Fcompiler%2Fmain%2FDriverState.hs;h=cb8e6a974f882b7e0c5e7bd0c1ef7a40f7369582;hb=4a4b87decd8a2c989d0d68a65c1ae0d1e115ecf5;hp=23c7cbb42c6a7ae6dac97e978b8b37f8d821ad89;hpb=443a09fbf625a6fffa4804a2193fd9840ffba35b;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverState.hs b/ghc/compiler/main/DriverState.hs index 23c7cbb..cb8e6a9 100644 --- a/ghc/compiler/main/DriverState.hs +++ b/ghc/compiler/main/DriverState.hs @@ -205,21 +205,20 @@ GLOBAL_VAR(v_Framework_paths, [], [String]) GLOBAL_VAR(v_Cmdline_frameworks, [], [String]) #endif -addToOrDeleteDirList :: IORef [String] -> String -> IO () -addToOrDeleteDirList ref "" = writeIORef ref [] -addToOrDeleteDirList ref path = addToDirList ref path - addToDirList :: IORef [String] -> String -> IO () addToDirList ref path = do paths <- readIORef ref - shiny_new_ones <- splitUp path - writeIORef ref (paths ++ filter notNull shiny_new_ones) + shiny_new_ones <- splitPathList path + writeIORef ref (paths ++ shiny_new_ones) + + +splitPathList :: String -> IO [String] +splitPathList s = do ps <- splitUp s; return (filter notNull ps) -- empty paths are ignored: there might be a trailing -- ':' in the initial list, for example. Empty paths can -- cause confusion when they are translated into -I options -- for passing to gcc. where - splitUp ::String -> IO [String] #ifdef mingw32_TARGET_OS -- 'hybrid' support for DOS-style paths in directory lists. --