From 86d6ddb1b13aed8147af8ae2e9e3f01707b90b38 Mon Sep 17 00:00:00 2001 From: panne Date: Sun, 25 Jun 2000 17:21:52 +0000 Subject: [PATCH] [project @ 2000-06-25 17:21:52 by panne] * -#include's arg needs not be separate anymore. * Nuke leading and trailing spaces around option arguments. --- ghc/driver/Main.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs index 4535f29..f27c26a 100644 --- a/ghc/driver/Main.hs +++ b/ghc/driver/Main.hs @@ -1656,7 +1656,7 @@ opts = ------- Miscellaneous ----------------------------------------------- , ( "cpp" , NoArg (writeIORef cpp_flag True) ) - , ( "#include" , SepArg (add cmdline_hc_includes) ) + , ( "#include" , HasArg (add cmdline_hc_includes) ) , ( "no-link-chk" , NoArg (return ()) ) -- ignored for backwards compat ------- Output Redirection ------------------------------------------ @@ -1835,9 +1835,9 @@ processOneArg (('-':arg):args) = do findArg :: String -> (String,OptKind) findArg arg - = case [ (rest,k) | (pat,k) <- opts, - Just rest <- [my_prefix_match pat arg], - is_prefix k || null rest ] of + = case [ (remove_spaces rest, k) | (pat,k) <- opts, + Just rest <- [my_prefix_match pat arg], + is_prefix k || null rest ] of [] -> throwDyn (UnknownFlag ('-':arg)) (one:_) -> one @@ -1971,3 +1971,6 @@ newsuf suf s = remove_suffix s '.' ++ suf newdir :: String -> String -> String newdir dir s = dir ++ '/':drop_longest_prefix s '/' + +remove_spaces :: String -> String +remove_spaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace -- 1.7.10.4