Commit e216a6a7 authored by Simon Marlow's avatar Simon Marlow
Browse files

FIX #1838: use System.Directory.getHomeDirectory instead of getEnv "HOME"

parent 54a32229
......@@ -334,7 +334,7 @@ runGHCi paths maybe_expr = do
when (read_dot_files) $ do
-- Read in $HOME/.ghci
either_dir <- io (IO.try (getEnv "HOME"))
either_dir <- io (IO.try getHomeDirectory)
case either_dir of
Left _e -> return ()
Right dir -> do
......@@ -1535,7 +1535,7 @@ expandPath :: String -> GHCi String
expandPath path =
case dropWhile isSpace path of
('~':d) -> do
tilde <- io (getEnv "HOME") -- will fail if HOME not defined
tilde <- io getHomeDirectory -- will fail if HOME not defined
return (tilde ++ '/':d)
other ->
return other
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment