@@ -188,6 +188,13 @@ defaultMainWithAction startAction = flip withArgs $ do
188188 Right postLoadMode ->
189189 main' postLoadMode dflagsExtra1 argv3 flagWarnings startAction r
190190
191+ strt_dot_sl :: String -> Bool
192+ #if defined(mingw32_HOST_OS)
193+ strt_dot_sl fp = " ./" `isPrefixOf` fp || " .\\ " `isPrefixOf` fp
194+ #else
195+ strt_dot_sl fp = " ./" `isPrefixOf` fp
196+ #endif
197+
191198main' :: PostLoadMode -> DynFlags -> [Located String ] -> [Warn ]
192199 -> Ghc () -> IORef ClashOpts
193200 -> Ghc ()
@@ -275,14 +282,9 @@ main' postLoadMode dflags0 args flagWarnings startAction clashOpts = do
275282 -- #12674: Filenames starting with a hypen get normalised from ./-foo.hs
276283 -- to -foo.hs. We have to re-prepend the current directory.
277284 normalise_hyp fp
278- | strt_dot_sl && " -" `isPrefixOf` nfp = cur_dir ++ nfp
285+ | strt_dot_sl fp && " -" `isPrefixOf` nfp = cur_dir ++ nfp
279286 | otherwise = nfp
280287 where
281- #if defined(mingw32_HOST_OS)
282- strt_dot_sl = " ./" `isPrefixOf` fp || " .\\ " `isPrefixOf` fp
283- #else
284- strt_dot_sl = " ./" `isPrefixOf` fp
285- #endif
286288 cur_dir = ' .' : [pathSeparator]
287289 nfp = normalise fp
288290 normal_fileish_paths = map (normalise_hyp . unLoc) fileish_args
@@ -829,14 +831,19 @@ doShowIface dflags file = do
829831-- ---------------------------------------------------------------------------
830832-- Various banners and verbosity output.
831833
834+ -- Show the GHCi banner
835+ showGhciWelcomeMsg :: IO ()
836+ #if defined(HAVE_INTERNAL_INTERPRETER)
837+ showGhciWelcomeMsg = putStrLn ghciWelcomeMsg
838+ #else
839+ showGhciWelcomeMsg = pure ()
840+ #endif
841+
832842showBanner :: PostLoadMode -> DynFlags -> IO ()
833843showBanner _postLoadMode dflags = do
834844 let verb = verbosity dflags
835845
836- #if defined(HAVE_INTERNAL_INTERPRETER)
837- -- Show the GHCi banner
838- when (isInteractiveMode _postLoadMode && verb >= 1 ) $ putStrLn ghciWelcomeMsg
839- #endif
846+ when (isInteractiveMode _postLoadMode && verb >= 1 ) showGhciWelcomeMsg
840847
841848 -- Display details of the configuration in verbose mode
842849 when (verb >= 2 ) $
0 commit comments