From: simonpj Date: Mon, 23 May 2005 09:56:03 +0000 (+0000) Subject: [project @ 2005-05-23 09:56:03 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~491 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e164999e67db1c5be44d84dd9c33e6255928583f;p=ghc-hetmet.git [project @ 2005-05-23 09:56:03 by simonpj] Track new semantics of splitLongestPrefix; fixes -main-is bug --- 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