@@ -188,6 +188,13 @@ defaultMainWithAction startAction = flip withArgs $ do
188
188
Right postLoadMode ->
189
189
main' postLoadMode dflagsExtra1 argv3 flagWarnings startAction r
190
190
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
+
191
198
main' :: PostLoadMode -> DynFlags -> [Located String ] -> [Warn ]
192
199
-> Ghc () -> IORef ClashOpts
193
200
-> Ghc ()
@@ -275,14 +282,9 @@ main' postLoadMode dflags0 args flagWarnings startAction clashOpts = do
275
282
-- #12674: Filenames starting with a hypen get normalised from ./-foo.hs
276
283
-- to -foo.hs. We have to re-prepend the current directory.
277
284
normalise_hyp fp
278
- | strt_dot_sl && " -" `isPrefixOf` nfp = cur_dir ++ nfp
285
+ | strt_dot_sl fp && " -" `isPrefixOf` nfp = cur_dir ++ nfp
279
286
| otherwise = nfp
280
287
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
286
288
cur_dir = ' .' : [pathSeparator]
287
289
nfp = normalise fp
288
290
normal_fileish_paths = map (normalise_hyp . unLoc) fileish_args
@@ -829,14 +831,19 @@ doShowIface dflags file = do
829
831
-- ---------------------------------------------------------------------------
830
832
-- Various banners and verbosity output.
831
833
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
+
832
842
showBanner :: PostLoadMode -> DynFlags -> IO ()
833
843
showBanner _postLoadMode dflags = do
834
844
let verb = verbosity dflags
835
845
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
840
847
841
848
-- Display details of the configuration in verbose mode
842
849
when (verb >= 2 ) $
0 commit comments