X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory%2FInternals.hs;h=c763764974c4676da9c33d9c0eea2a078fdd4730;hb=30c6a57ac9dfc3808a28bb2654912aa7460568c8;hp=761b7714d7e19b04bbd853fae422fb99528c89af;hpb=ec3ba94b254bd444e7a1c560c1d91c4879948c69;p=haskell-directory.git diff --git a/System/Directory/Internals.hs b/System/Directory/Internals.hs index 761b771..c763764 100644 --- a/System/Directory/Internals.hs +++ b/System/Directory/Internals.hs @@ -124,15 +124,22 @@ pathParents p = -- | 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 -------------------------------------------------------------- -- * Separators