diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-22 20:47:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-22 20:47:14 -0400 |
commit | f4e2dde8a8ceaf689ec5391174b53cb1b213ea8b (patch) | |
tree | a2865cce91287fa8fcb1aedba1c3759245bb9823 /Utility.hs | |
parent | ff38e49eb453ccfd58ce0e424aeca97389ab0100 (diff) |
fix perl refugee code
Diffstat (limited to 'Utility.hs')
-rw-r--r-- | Utility.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Utility.hs b/Utility.hs index 8bffde057..8e620c64c 100644 --- a/Utility.hs +++ b/Utility.hs @@ -45,7 +45,7 @@ hGetContentsStrict h = hGetContents h >>= \s -> length s `seq` return s {- Returns the parent directory of a path. Parent of / is "" -} parentDir :: String -> String parentDir dir = - if length dirs > 0 + if (not $ null dirs) then slash ++ (join s $ take ((length dirs) - 1) dirs) else "" where @@ -81,7 +81,7 @@ relPathCwdToDir dir = do -} relPathDirToDir :: FilePath -> FilePath -> FilePath relPathDirToDir from to = - if (0 < length path) + if (not $ null path) then addTrailingPathSeparator path else "" where |