mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
Handling absolute paths in prefixPathName :: String -> FilePath -> FilePath
Handling absolute paths in prefixPathName :: String -> FilePath -> FilePath (absolute paths are simply never prefixed).
This commit is contained in:
@@ -94,8 +94,11 @@ pFilePaths s = case span (/=':') s of
|
|||||||
(f,_) -> [f]
|
(f,_) -> [f]
|
||||||
|
|
||||||
prefixPathName :: String -> FilePath -> FilePath
|
prefixPathName :: String -> FilePath -> FilePath
|
||||||
prefixPathName "" f = f
|
prefixPathName p f = case f of
|
||||||
prefixPathName p f = p ++ "/" ++ f
|
'/':_ -> f -- do not prefix [Unix style] absolute paths
|
||||||
|
_ -> case p of
|
||||||
|
"" -> f
|
||||||
|
_ -> p ++ "/" ++ f
|
||||||
|
|
||||||
justInitPath :: FilePath -> FilePath
|
justInitPath :: FilePath -> FilePath
|
||||||
justInitPath = reverse . drop 1 . dropWhile (/='/') . reverse
|
justInitPath = reverse . drop 1 . dropWhile (/='/') . reverse
|
||||||
|
|||||||
Reference in New Issue
Block a user