summaryrefslogtreecommitdiff
path: root/src/GF/Infra
diff options
context:
space:
mode:
authoraarne <unknown>2004-06-21 08:53:58 +0000
committeraarne <unknown>2004-06-21 08:53:58 +0000
commitb248e6e25e5b58163cc9b897be7eb0b4bf6dbdc6 (patch)
tree74d74c06998903a16c5909eafc9835e1ca68491d /src/GF/Infra
parenta134a1fd65c80bae1e37d304fc674453e126c504 (diff)
for release meeting
Diffstat (limited to 'src/GF/Infra')
-rw-r--r--src/GF/Infra/UseIO.hs7
1 files changed, 7 insertions, 0 deletions
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