packages feed

filepath 1.4.100.2 → 1.4.100.3

raw patch · 4 files changed

+12/−2 lines, 4 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

System/FilePath/Internal.hs view
@@ -601,6 +601,7 @@ -- > splitFileName "bob" == ("./", "bob") -- > Posix:   splitFileName "/" == ("/","") -- > Windows: splitFileName "c:" == ("c:","")+-- > Windows: splitFileName "\\\\?\\A:\\fred" == ("\\\\?\\A:\\","fred") splitFileName :: FILEPATH -> (STRING, STRING) splitFileName x = if null path     then (dotSlash, file)@@ -648,12 +649,15 @@   -- If bs' is empty, then s2 as the last character of dirSlash must be a path separator,   -- so we are in the middle of shared drive.   -- Otherwise, since s1 is a path separator, we might be in the middle of UNC path.-  , null bs' || maybe False (null . snd) (readDriveUNC dirSlash)+  , null bs' || maybe False isIncompleteUNC (readDriveUNC dirSlash)   = (fp, mempty)   | otherwise   = (dirSlash, file)   where     (dirSlash, file) = breakEnd isPathSeparator fp++    isIncompleteUNC (pref, suff) = null suff && not (hasPenultimateColon pref)+    hasPenultimateColon = maybe False (maybe False ((== _colon) . snd) . unsnoc . fst) . unsnoc  -- | Set the filename. --
changelog.md view
@@ -2,6 +2,10 @@  _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._ +## 1.4.100.3 *Feb 2023*++* Fix a regression in `splitFileName` wrt [#189](https://github.com/haskell/filepath/pull/189)+ ## 1.4.100.2 *Feb 2023*  * Speed up `splitFileName`, `splitExtension`, `readDriveLetter` and various other helpers (up to 20x faster) by @Bodigrim
filepath.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.2 name:               filepath-version:            1.4.100.2+version:            1.4.100.3  -- NOTE: Don't forget to update ./changelog.md license:            BSD-3-Clause
tests/filepath-tests/TestGen.hs view
@@ -456,6 +456,8 @@     ,("AFP_P.splitFileName (\"/\") == ((\"/\"), (\"\"))", property $ AFP_P.splitFileName ("/") == (("/"), ("")))     ,("W.splitFileName \"c:\" == (\"c:\", \"\")", property $ W.splitFileName "c:" == ("c:", ""))     ,("AFP_W.splitFileName (\"c:\") == ((\"c:\"), (\"\"))", property $ AFP_W.splitFileName ("c:") == (("c:"), ("")))+    ,("W.splitFileName \"\\\\\\\\?\\\\A:\\\\fred\" == (\"\\\\\\\\?\\\\A:\\\\\", \"fred\")", property $ W.splitFileName "\\\\?\\A:\\fred" == ("\\\\?\\A:\\", "fred"))+    ,("AFP_W.splitFileName (\"\\\\\\\\?\\\\A:\\\\fred\") == ((\"\\\\\\\\?\\\\A:\\\\\"), (\"fred\"))", property $ AFP_W.splitFileName ("\\\\?\\A:\\fred") == (("\\\\?\\A:\\"), ("fred")))     ,("P.replaceFileName \"/directory/other.txt\" \"file.ext\" == \"/directory/file.ext\"", property $ P.replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext")     ,("W.replaceFileName \"/directory/other.txt\" \"file.ext\" == \"/directory/file.ext\"", property $ W.replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext")     ,("AFP_P.replaceFileName (\"/directory/other.txt\") (\"file.ext\") == (\"/directory/file.ext\")", property $ AFP_P.replaceFileName ("/directory/other.txt") ("file.ext") == ("/directory/file.ext"))