summaryrefslogtreecommitdiff
path: root/ghc/InteractiveUI.hs
diff options
context:
space:
mode:
authorPaolo Capriotti <p.capriotti@gmail.com>2012-03-28 16:11:34 +0100
committerPaolo Capriotti <p.capriotti@gmail.com>2012-04-11 18:42:50 +0100
commit0a532c6ba5df245aef4f2a127bd0e3ae40048334 (patch)
tree1adb606b4f2b1ed1cabb3ec91c24ba6a2ff01e52 /ghc/InteractiveUI.hs
parent76bde331226e933b65b6433e983c50da1ce3b532 (diff)
downloadhaskell-0a532c6ba5df245aef4f2a127bd0e3ae40048334.tar.gz
Do not re-encode correctly encoded inputs and arguments (#5795)
Diffstat (limited to 'ghc/InteractiveUI.hs')
-rw-r--r--ghc/InteractiveUI.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index b7e6241033..8d6e23c678 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -446,10 +446,8 @@ runGHCi paths maybe_exprs = do
when (not (null paths)) $ do
ok <- ghciHandle (\e -> do showException e; return Failed) $
-- TODO: this is a hack.
- runInputTWithPrefs defaultPrefs defaultSettings $ do
- let (filePaths, phases) = unzip paths
- filePaths' <- mapM (Encoding.decode . BS.pack) filePaths
- loadModule (zip filePaths' phases)
+ runInputTWithPrefs defaultPrefs defaultSettings $
+ loadModule paths
when (isJust maybe_exprs && failed ok) $
liftIO (exitWith (ExitFailure 1))
@@ -2884,10 +2882,7 @@ isHomeModule m = GHC.modulePackageId m == mainPackageId
-- TODO: won't work if home dir is encoded.
-- (changeDirectory may not work either in that case.)
expandPath :: MonadIO m => String -> InputT m String
-expandPath p = do
- exp_path <- liftIO $ expandPathIO p
- e <- fmap BS.unpack $ Encoding.encode exp_path
- return e
+expandPath = liftIO . expandPathIO
expandPathIO :: String -> IO String
expandPathIO p =