summaryrefslogtreecommitdiff
path: root/Utility.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-22 20:47:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-22 20:47:14 -0400
commitf4e2dde8a8ceaf689ec5391174b53cb1b213ea8b (patch)
treea2865cce91287fa8fcb1aedba1c3759245bb9823 /Utility.hs
parentff38e49eb453ccfd58ce0e424aeca97389ab0100 (diff)
fix perl refugee code
Diffstat (limited to 'Utility.hs')
-rw-r--r--Utility.hs4
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