From c04875b33e25796ec68ad267bbe80308b46f50ba Mon Sep 17 00:00:00 2001 From: ijones Date: Fri, 21 Oct 2005 16:31:39 +0000 Subject: [PATCH] cvs pull from krasimir & simon 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 --- Distribution/Compat/FilePath.hs | 21 ++++++++++++++------- package.conf.in | 3 ++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Distribution/Compat/FilePath.hs b/Distribution/Compat/FilePath.hs index 881b80875f4..0fc3b94540b 100644 --- a/Distribution/Compat/FilePath.hs +++ b/Distribution/Compat/FilePath.hs @@ -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'. diff --git a/package.conf.in b/package.conf.in index d6f3c1d83a3..ce13a1ef507 100644 --- a/package.conf.in +++ b/package.conf.in @@ -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,