aboutsummaryrefslogtreecommitdiff
path: root/Utility/FreeDesktop.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 18:29:07 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 18:55:56 -0400
commit2bba5bc22d049272d3328bfa6c452d3e2e50e86c (patch)
tree19feab50e43dc330038224ea98b371916ca02133 /Utility/FreeDesktop.hs
parent014e909a449d0822eff4962a504d6a524abe8fc7 (diff)
made parentDir return a Maybe FilePath; removed most uses of it
parentDir is less safe than takeDirectory, especially when working with relative FilePaths. It's really only useful in loops that want to terminate at / This commit was sponsored by Audric SCHILTKNECHT.
Diffstat (limited to 'Utility/FreeDesktop.hs')
-rw-r--r--Utility/FreeDesktop.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs
index c1f042ce8..208a392e9 100644
--- a/Utility/FreeDesktop.hs
+++ b/Utility/FreeDesktop.hs
@@ -27,7 +27,6 @@ module Utility.FreeDesktop (
) where
import Utility.Exception
-import Utility.Path
import Utility.UserInfo
import Utility.Process
import Utility.PartialPrelude
@@ -79,7 +78,7 @@ buildDesktopMenuFile d = unlines ("[Desktop Entry]" : map keyvalue d) ++ "\n"
writeDesktopMenuFile :: DesktopEntry -> String -> IO ()
writeDesktopMenuFile d file = do
- createDirectoryIfMissing True (parentDir file)
+ createDirectoryIfMissing True (takeDirectory file)
writeFile file $ buildDesktopMenuFile d
{- Path to use for a desktop menu file, in either the systemDataDir or