From e164999e67db1c5be44d84dd9c33e6255928583f Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 23 May 2005 09:56:03 +0000 Subject: [PATCH] [project @ 2005-05-23 09:56:03 by simonpj] Track new semantics of splitLongestPrefix; fixes -main-is bug --- ghc/compiler/main/DynFlags.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/main/DynFlags.hs b/ghc/compiler/main/DynFlags.hs index 09932b6..b916422 100644 --- a/ghc/compiler/main/DynFlags.hs +++ b/ghc/compiler/main/DynFlags.hs @@ -65,7 +65,7 @@ import Data.List ( isPrefixOf ) #endif import Maybe ( fromJust ) import Char ( isDigit, isUpper ) - +import Outputable -- ----------------------------------------------------------------------------- -- DynFlags @@ -1043,18 +1043,17 @@ setOptLevel n dflags setMainIs :: String -> DynP () setMainIs arg - | not (null main_mod) -- The arg looked like "Foo.baz" + | not (null main_fn) -- The arg looked like "Foo.baz" = upd $ \d -> d{ mainFunIs = Just main_fn, mainModIs = Just main_mod } - | isUpper (head main_fn) -- The arg looked like "Foo" - = upd $ \d -> d{ mainModIs = Just main_fn } + | isUpper (head main_mod) -- The arg looked like "Foo" + = upd $ \d -> d{ mainModIs = Just main_mod } | otherwise -- The arg looked like "baz" - = upd $ \d -> d{ mainFunIs = Just main_fn } + = upd $ \d -> d{ mainFunIs = Just main_mod } where (main_mod, main_fn) = splitLongestPrefix arg (== '.') - ----------------------------------------------------------------------------- -- Paths & Libraries -- 1.7.10.4