From: simonpj Date: Tue, 22 Mar 2005 17:33:38 +0000 (+0000) Subject: [project @ 2005-03-22 17:33:38 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~872 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=d3585c0a1c3abeeaa23817454c07efe76174c081;p=ghc-hetmet.git [project @ 2005-03-22 17:33:38 by simonpj] Windows wibbles --- diff --git a/ghc/compiler/main/DynFlags.hs b/ghc/compiler/main/DynFlags.hs index e138f47..fc48857 100644 --- a/ghc/compiler/main/DynFlags.hs +++ b/ghc/compiler/main/DynFlags.hs @@ -60,6 +60,7 @@ import Util ( notNull, splitLongestPrefix, split, normalisePath ) import DATA_IOREF ( readIORef ) import EXCEPTION ( throwDyn ) import Monad ( when ) +import Data.List ( isPrefixOf ) import Maybe ( fromJust ) import Char ( isDigit, isUpper ) @@ -1092,20 +1093,20 @@ splitPathList s = filter notNull (splitUp s) -- that this will cause too much breakage for users & ':' will -- work fine even with DOS paths, if you're not insisting on being silly. -- So, use either. - splitUp [] = [] - splitUp (x:':':div:xs) - | div `elem` dir_markers = do - let (p,rs) = findNextPath xs - in ((x:':':div:p): splitUp rs) + splitUp [] = [] + splitUp (x:':':div:xs) | div `elem` dir_markers + = ((x:':':div:p): splitUp rs) + where + (p,rs) = findNextPath xs -- we used to check for existence of the path here, but that -- required the IO monad to be threaded through the command-line -- parser which is quite inconvenient. The - splitUp xs = do - let (p,rs) = findNextPath xs - return (cons p (splitUp rs)) + splitUp xs = cons p (splitUp rs) + where + (p,rs) = findNextPath xs - cons "" xs = xs - cons x xs = x:xs + cons "" xs = xs + cons x xs = x:xs -- will be called either when we've consumed nought or the -- ":/" part of a DOS path, so splitting is just a Q of