improve comments

This commit is contained in:
Joey Hess 2021-12-08 18:59:22 -04:00
parent 4a1758fccf
commit bba74a2b84
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -86,10 +86,10 @@ encodeBL = L8.fromString
decodeBS :: S.ByteString -> FilePath decodeBS :: S.ByteString -> FilePath
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
-- This is a copy of code from System.FilePath.Internal.decodeFilePath. -- This does the same thing as System.FilePath.ByteString.decodeFilePath,
-- However, older versions of that library truncated at NUL, which this -- with an identical implementation. However, older versions of that library
-- must not do, because it may end up used on something other than a unix -- truncated at NUL, which this must not do, because it may end up used on
-- filepath. -- something other than a unix filepath.
{-# NOINLINE decodeBS #-} {-# NOINLINE decodeBS #-}
decodeBS b = unsafePerformIO $ do decodeBS b = unsafePerformIO $ do
enc <- Encoding.getFileSystemEncoding enc <- Encoding.getFileSystemEncoding
@ -100,10 +100,10 @@ decodeBS = S8.toString
encodeBS :: FilePath -> S.ByteString encodeBS :: FilePath -> S.ByteString
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
-- This is a copy of code from System.FilePath.Internal.encodeFilePath. -- This does the same thing as System.FilePath.ByteString.encodeFilePath,
-- However, older versions of that library truncated at NUL, which this -- with an identical implementation. However, older versions of that library
-- must not do, because it may end up used on something other than a unix -- truncated at NUL, which this must not do, because it may end up used on
-- filepath. -- something other than a unix filepath.
{-# NOINLINE encodeBS #-} {-# NOINLINE encodeBS #-}
encodeBS f = unsafePerformIO $ do encodeBS f = unsafePerformIO $ do
enc <- Encoding.getFileSystemEncoding enc <- Encoding.getFileSystemEncoding