summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-07-04 14:10:41 +0000
committeraarne <aarne@cs.chalmers.se>2007-07-04 14:10:41 +0000
commit2b5197d61d69f3843c6de31c9e6aa21243f66cde (patch)
tree54cd57fa864f849ae38399ca40aa5571557a189e /src/GF
parent51d3ade165a967580f16b41ef3e00cde08c6ff09 (diff)
tutorial exercises; put libdir in place in GF/src
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Infra/UseIO.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/GF/Infra/UseIO.hs b/src/GF/Infra/UseIO.hs
index 76563b5ad..dd8ad8d1a 100644
--- a/src/GF/Infra/UseIO.hs
+++ b/src/GF/Infra/UseIO.hs
@@ -17,6 +17,7 @@ module GF.Infra.UseIO where
import GF.Data.Operations
import GF.System.Arch (prCPU)
import GF.Infra.Option
+import GF.Today (libdir)
import System.Directory
import System.IO
@@ -114,8 +115,8 @@ doesFileExistPath paths file = do
-- | path in environment variable has lower priority
extendPathEnv :: String -> String -> [FilePath] -> IO [FilePath]
extendPathEnv lib var ps = do
- b <- catch (getEnv lib) (const (return "")) -- e.g. GF_LIB_PATH
- s <- catch (getEnv var) (const (return "")) -- e.g. GF_GRAMMAR_PATH
+ b <- catch (getEnv lib) (const (return libdir)) -- e.g. GF_LIB_PATH
+ s <- catch (getEnv var) (const (return "")) -- e.g. GF_GRAMMAR_PATH
let fs = pFilePaths s
let ss = ps ++ fs
liftM concat $ mapM allSubdirs $ ss ++ [b ++ "/" ++ s | s <- ss]
@@ -322,7 +323,7 @@ readFileLibraryIOE ini f =
initPath = addInitFilePath ini f
getLibPath :: IO String
getLibPath = do {
- lp <- getEnv gfLibraryPath;
+ lp <- catch (getEnv gfLibraryPath) (const (return libdir)) ;
return (if isSep (last lp) then lp else lp ++ ['/']);
}
reportOn f = "File " ++ f ++ " not found."