From f52324bb86a403f41ad9fc2050bc350fd7635714 Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Thu, 19 Jan 2006 20:28:27 +0000 Subject: 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.) --- src/HaddockUtil.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3