summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Infra/UseIO.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GF/Infra/UseIO.hs b/src/GF/Infra/UseIO.hs
index d06904297..b37e695bc 100644
--- a/src/GF/Infra/UseIO.hs
+++ b/src/GF/Infra/UseIO.hs
@@ -94,8 +94,11 @@ pFilePaths s = case span (/=':') s of
(f,_) -> [f]
prefixPathName :: String -> FilePath -> FilePath
-prefixPathName "" f = f
-prefixPathName p f = p ++ "/" ++ f
+prefixPathName p f = case f of
+ '/':_ -> f -- do not prefix [Unix style] absolute paths
+ _ -> case p of
+ "" -> f
+ _ -> p ++ "/" ++ f
justInitPath :: FilePath -> FilePath
justInitPath = reverse . drop 1 . dropWhile (/='/') . reverse