diff options
author | Duncan Coutts <duncan.coutts@worc.ox.ac.uk> | 2006-01-19 20:28:27 +0000 |
---|---|---|
committer | Duncan Coutts <duncan.coutts@worc.ox.ac.uk> | 2006-01-19 20:28:27 +0000 |
commit | f52324bb86a403f41ad9fc2050bc350fd7635714 (patch) | |
tree | 7d81a3ab8df7a5f27c2020fb2a840977478f4fa1 /src | |
parent | 17adfda903a5bf9051159beb61cb37dc084eb8b4 (diff) |
Rewrite pathJoin to only add a path separator when necessary.
When the path ends in a file seperator there is no need to add another.
Now using "--wiki=http://blah.com/foo/" should do the right thing.
(Code snippet adapted from Isaac's FilePath package.)
Diffstat (limited to 'src')
-rw-r--r-- | src/HaddockUtil.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index 96dc7a0b..0c458049 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -403,10 +403,13 @@ subIndexHtmlFile a = "doc-index-" ++ b ++ ".html" | otherwise = show (ord a) pathJoin :: [FilePath] -> FilePath -pathJoin = concat . intersperse pathSeparatorStr - -pathSeparatorStr :: String -pathSeparatorStr = [pathSeparator] +pathJoin = foldr join [] + where join :: FilePath -> FilePath -> FilePath + join path1 "" = path1 + join "" path2 = path2 + join path1 path2 + | isPathSeparator (last path1) = path1++path2 + | otherwise = path1++pathSeparator:path2 -- ----------------------------------------------------------------------------- -- Files we need to copy from our $libdir |