Skip to content

Commit

Permalink
cvs pull from krasimir & simon
Browse files Browse the repository at this point in the history
  from Neil Mitchell (fixed by Krasimir):
  
  On Windows, the path can be path;"c:\ghc\ghc-6.4\bin";restofpath, and
  thats still a valid path with GHC in it. Cabal doesn't find ghc with
  the quotes in, removing them does find it though.

SimonMar:
  Add Distribution.Program to exposed-modules
  • Loading branch information
SyntaxPolice committed Oct 21, 2005
1 parent 6ca996a commit c04875b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
21 changes: 14 additions & 7 deletions Distribution/Compat/FilePath.hs
Expand Up @@ -351,15 +351,22 @@ commonParent paths@(p:ps) =
-- | The function splits the given string to substrings
-- using the 'searchPathSeparator'.
parseSearchPath :: String -> [FilePath]
parseSearchPath path = split searchPathSeparator path
parseSearchPath path = split path
where
split :: Char -> String -> [String]
split c s =
case rest of
[] -> [chunk]
_:rest' -> chunk : split c rest'
split :: String -> [String]
split s =
case rest' of
[] -> [chunk]
_:rest -> chunk : split rest
where
(chunk, rest) = break (==c) s
chunk =
case chunk' of
#ifdef mingw32_HOST_OS
('\"':xs@(_:_)) | last xs == '\"' -> init xs
#endif
_ -> chunk'

(chunk', rest') = break (==searchPathSeparator) s

-- | The function concatenates the given paths to form a
-- single string where the paths are separated with 'searchPathSeparator'.
Expand Down
3 changes: 2 additions & 1 deletion package.conf.in
Expand Up @@ -18,10 +18,11 @@ exposed-modules:
Distribution.PackageDescription,
Distribution.ParseUtils,
Distribution.PreProcess,
Distribution.PreProcess.Unlit,
Distribution.Program,
Distribution.Setup,
Distribution.Simple,
Distribution.Version,
Distribution.PreProcess.Unlit,
Distribution.Simple.Build,
Distribution.Simple.Configure,
Distribution.Simple.GHCPackageConfig,
Expand Down

0 comments on commit c04875b

Please sign in to comment.