Skip to content

Commit

Permalink
Merge pull request haskell#36 from thomie/searchPath
Browse files Browse the repository at this point in the history
Remove double quotes around searchPath elements on Windows
  • Loading branch information
ndmitchell committed Nov 1, 2014
2 parents 7ab78f9 + 89b7171 commit 83b6d8c
Show file tree
Hide file tree
Showing 3 changed files with 340 additions and 334 deletions.
2 changes: 2 additions & 0 deletions System/FilePath/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ isExtSeparator = (== extSeparator)
-- > Posix: splitSearchPath "File1::File2:File3" == ["File1",".","File2","File3"]
-- > Windows: splitSearchPath "File1;File2;File3" == ["File1","File2","File3"]
-- > Windows: splitSearchPath "File1;;File2;File3" == ["File1","File2","File3"]
-- > Windows: splitSearchPath "File1;\"File2\";File3" == ["File1","File2","File3"]
splitSearchPath :: String -> [FilePath]
splitSearchPath = f
where
Expand All @@ -188,6 +189,7 @@ splitSearchPath = f
(pre, _:post) -> g pre ++ f post

g "" = ["." | isPosix]
g ('\"':x@(_:_)) | isWindows && last x == '\"' = [init x]
g x = [x]


Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backsl

* Bundled with GHC 7.10.1

* Semantic change: `joinDrive /foo bar` now returns `/foo/bar`, instead of `/foobar`
* Semantic change: `joinDrive /foo bar` now returns `/foo/bar`, instead of `/foobar`

* Semantic change: on Windows, `splitSearchPath File1;\"File 2\"` now returns `[File1,File2]` instead of `[File1,\"File2\"]`

* Bug fix: on Posix systems, `normalise //home` now returns `/home`, instead of `//home`

Expand Down
Loading

0 comments on commit 83b6d8c

Please sign in to comment.