From b248e6e25e5b58163cc9b897be7eb0b4bf6dbdc6 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 21 Jun 2004 08:53:58 +0000 Subject: for release meeting --- src/GF/Infra/UseIO.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/GF/Infra/UseIO.hs') diff --git a/src/GF/Infra/UseIO.hs b/src/GF/Infra/UseIO.hs index 243ead306..3dc41fadc 100644 --- a/src/GF/Infra/UseIO.hs +++ b/src/GF/Infra/UseIO.hs @@ -81,6 +81,13 @@ doesFileExistPath paths file = do mpfile <- ioeIO $ getFilePath paths file return $ maybe False (const True) mpfile +-- path in environment variable has lower priority +extendPathEnv :: String -> [FilePath] -> IO [FilePath] +extendPathEnv var ps = do + s <- catch (getEnv var) (const (return "")) + let fs = pFilePaths s + return $ ps ++ fs + pFilePaths :: String -> [FilePath] pFilePaths s = case span (/=':') s of (f,_:cs) -> f : pFilePaths cs -- cgit v1.2.3