This commit is contained in:
Julian Ospald 2020-04-14 10:40:33 +02:00
parent dc4e652f3a
commit e194fdec91
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 4 additions and 1 deletions

View File

@ -34,6 +34,7 @@ library
build-depends: base >= 4.8 && <5 build-depends: base >= 4.8 && <5
, IfElse , IfElse
, bytestring >= 0.10 , bytestring >= 0.10
, deepseq
, exceptions >= 0.10 , exceptions >= 0.10
, hpath-filepath >= 0.10.3 , hpath-filepath >= 0.10.3
, safe-exceptions >= 0.1 , safe-exceptions >= 0.1

View File

@ -41,6 +41,7 @@ module System.Posix.RawFilePath.Directory.Traversals (
#if __GLASGOW_HASKELL__ < 710 #if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>)) import Control.Applicative ((<$>))
#endif #endif
import Control.DeepSeq
import Control.Monad import Control.Monad
import System.Posix.FilePath ((</>)) import System.Posix.FilePath ((</>))
import System.Posix.Foreign import System.Posix.Foreign
@ -193,10 +194,11 @@ readDirEnt (unpackDirStream -> dirp) =
if (r == 0) if (r == 0)
then do then do
dEnt <- peek ptr_dEnt dEnt <- peek ptr_dEnt
putStrLn $ "readDirEnt dEnt " ++ (show dEnt)
if (dEnt == nullPtr) if (dEnt == nullPtr)
then return (dtUnknown,BS.empty) then return (dtUnknown,BS.empty)
else do else do
dName <- c_name dEnt >>= peekFilePath dName <- c_name dEnt >>= peekFilePath >>= evaluate . force
dType <- c_type dEnt dType <- c_type dEnt
c_freeDirEnt dEnt c_freeDirEnt dEnt
putStrLn $ "readDirEnt" ++ (show dName) putStrLn $ "readDirEnt" ++ (show dName)