[commit: packages/filepath] master: Merge branch 'normalise' of https://github.com/thomie/filepath into thomie-normalise (c30d722)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:35:02 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/c30d7224b3a648f2bdb0d0e19140f1a273f7cb06

>---------------------------------------------------------------

commit c30d7224b3a648f2bdb0d0e19140f1a273f7cb06
Merge: 72543cc eca255a
Author: Neil Mitchell <ndmitchell at gmail.com>
Date:   Sun Oct 26 21:41:11 2014 +0000

    Merge branch 'normalise' of https://github.com/thomie/filepath into thomie-normalise
    
    Conflicts:
    	System/FilePath/Internal.hs
    	changelog.md



>---------------------------------------------------------------

c30d7224b3a648f2bdb0d0e19140f1a273f7cb06
 System/FilePath/Internal.hs | 18 ++++++++++--------
 changelog.md                |  6 ++++++
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --cc System/FilePath/Internal.hs
index 1c0e012,8b67fb2..7dec998
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@@ -636,10 -640,20 +636,12 @@@ splitPath x = [drive | drive /= ""] ++ 
  -- >          splitDirectories "test/file" == ["test","file"]
  -- >          splitDirectories "/test/file" == ["/","test","file"]
  -- > Windows: splitDirectories "C:\\test\\file" == ["C:\\", "test", "file"]
 --- > Valid x => joinPath (splitDirectories x) `equalFilePath` x
 --- > splitDirectories "" == []
 +-- >          Valid x => joinPath (splitDirectories x) `equalFilePath` x
 +-- >          splitDirectories "" == []
+ -- > Windows: splitDirectories "C:\\test\\\\\\file" == ["C:\\", "test", "file"]
+ -- >          splitDirectories "/test///file" == ["/","test","file"]
  splitDirectories :: FilePath -> [FilePath]
 -splitDirectories path =
 -        if hasDrive path then head pathComponents : f (tail pathComponents)
 -        else f pathComponents
 -    where
 -        pathComponents = splitPath path
 -
 -        f = map g
 -        g x = if null res then x else res
 -            where res = takeWhile (not . isPathSeparator) x
 +splitDirectories = map dropTrailingPathSeparator . splitPath
  
  
  -- | Join path elements back together.
diff --cc changelog.md
index 7297e2f,3e87a9c..b037c48
--- a/changelog.md
+++ b/changelog.md
@@@ -9,12 -7,12 +9,18 @@@
    * Bug fix: on Windows, `dropTrailingPathSeparator "/"` now returns `"/"`
      unchanged, instead of the normalised `"\\"`.
  
 +  * Bug fix: on Windows, `equalFilePath "C:\\" "C:"` now retuns `False`,
 +    instead of `True`.
 +
 +  * Bug fix: on Windows, `isValid "\\\\\\foo"` now returns `False`, instead
 +    of `True`.
 +
+   * Bug fix: on Windows, `normalise "\\"` now retuns `"\\"` unchanged,
+     instead of `"\\\\"`.
+ 
+   * Bug fix: on Windows, `normalise "//server/test"` now retuns
+     `"\\\\server\\test"`, instead of `"//server/test"` unchanged.
+ 
  ## 1.3.0.2  *Mar 2014*
  
    * Bundled with GHC 7.8.1



More information about the ghc-commits mailing list