fix upFrom of "." (and upFrom of "/" on Windows)

This commit is contained in:
Joey Hess 2015-01-20 17:23:23 -04:00
parent 4f657aa14e
commit 27c24b7407

View file

@ -85,7 +85,7 @@ parentDir = takeDirectory . dropTrailingPathSeparator
- parent (ie for "/" or ".") -}
upFrom :: FilePath -> Maybe FilePath
upFrom dir
| null dirs = Nothing
| length dirs < 2 = Nothing
| otherwise = Just $ joinDrive drive (join s $ init dirs)
where
-- on Unix, the drive will be "/" when the dir is absolute, otherwise ""