filepath-bytestring 1.4.2.1.9 → 1.4.2.1.10
raw patch · 3 files changed
+18/−12 lines, 3 filesdep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring
API changes (from Hackage documentation)
Files
- CHANGELOG +7/−0
- System/FilePath/Internal.hs +8/−9
- filepath-bytestring.cabal +3/−3
CHANGELOG view
@@ -1,3 +1,10 @@+filepath-bytestring (1.4.2.1.10) unstable; urgency=medium++ * Depend on bytestring-0.11.2.0, and use it to implement encodeFilePath+ and decodeFilePath, whose code was previously copied from it.++ -- Joey Hess <id@joeyh.name> Wed, 08 Dec 2021 18:55:24 -0400+ filepath-bytestring (1.4.2.1.9) unstable; urgency=medium * Relax bounds to allow base 4.16 (ghc 9.2).
System/FilePath/Internal.hs view
@@ -136,15 +136,12 @@ import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B8-import Data.ByteString.Unsafe (unsafePackMallocCStringLen) import Data.Char(ord, chr, toUpper, toLower, isAsciiLower, isAsciiUpper) import Data.Maybe(isJust) import Data.Word(Word8) #ifdef mingw32_HOST_OS import qualified Data.ByteString.UTF8 as UTF8 #else-import qualified GHC.Foreign as GHC-import qualified GHC.IO.Encoding as Encoding import System.IO.Unsafe (unsafePerformIO) #endif import System.Environment (getEnv)@@ -171,13 +168,14 @@ -- (see `Encoding.getFileSystemEncoding`). -- -- When run on Windows, this encodes as UTF-8.+-- +-- the implementation of this function assumes that the+-- filesystem encoding will not be changed while the program is running. encodeFilePath :: FilePath -> RawFilePath #ifdef mingw32_HOST_OS encodeFilePath = UTF8.fromString #else-encodeFilePath f = unsafePerformIO $ do- enc <- Encoding.getFileSystemEncoding- GHC.newCStringLen enc f >>= unsafePackMallocCStringLen+encodeFilePath = unsafePerformIO . B.fromFilePath #endif -- | Convert from RawFilePath to FilePath@@ -186,14 +184,15 @@ -- (see `Encoding.getFileSystemEncoding`). -- -- When run on Windows, this decodes UTF-8.++-- The implementation of this function assumes that the+-- filesystem encoding will not be changed while the program is running. decodeFilePath :: RawFilePath -> FilePath #ifdef mingw32_HOST_OS decodeFilePath = UTF8.toString #else {-# NOINLINE decodeFilePath #-}-decodeFilePath f = unsafePerformIO $ do- enc <- Encoding.getFileSystemEncoding- B.useAsCStringLen f (GHC.peekCStringLen enc)+decodeFilePath = unsafePerformIO . B.toFilePath #endif ---------------------------------------------------------------------
filepath-bytestring.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: filepath-bytestring-version: 1.4.2.1.9+version: 1.4.2.1.10 -- NOTE: Don't forget to update CHANGELOG and the filepath dependency below license: BSD3 license-file: LICENSE@@ -50,7 +50,7 @@ build-depends: base >= 4 && < 4.17,- bytestring+ bytestring >= 0.11.2.0 if os(Windows) build-depends: utf8-string else@@ -71,7 +71,7 @@ build-depends: filepath-bytestring, base,- bytestring,+ bytestring >= 0.11.2.0, QuickCheck >= 2.7 && < 2.15, -- Versions of filepath that are equvilant to this -- library, for quickcheck equivilance tests.