From bd707fc19313d7c6a96e9367d08158d96f9310a1 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 16 Apr 2016 19:24:36 +0200 Subject: [PATCH] LIB: fix readFile, rm obsolete comment --- src/HSFM/FileSystem/FileType.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/HSFM/FileSystem/FileType.hs b/src/HSFM/FileSystem/FileType.hs index f230d4b..0641714 100644 --- a/src/HSFM/FileSystem/FileType.hs +++ b/src/HSFM/FileSystem/FileType.hs @@ -59,6 +59,10 @@ import System.IO.Error , isDoesNotExistErrorType ) import qualified System.Posix.Directory.ByteString as PFD +import System.Posix.FilePath + ( + () + ) import System.Posix.Directory.Traversals (realpath) import qualified System.Posix.Files.ByteString as PF import System.Posix.Types @@ -304,13 +308,11 @@ readFile ff p = constructFile fs fv p' | PF.isSymbolicLink fs = do -- symlink madness, we need to make sure we save the correct - -- AnchoredFile + -- File x <- PF.readSymbolicLink (P.fromAbs p') resolvedSyml <- handleDT p' $ do -- watch out, we call from 'filepath' here, but it is safe - -- TODO: could it happen that too many '..' lead - -- to something like '/' after normalization? - let sfp = (P.fromAbs . P.dirname $ p') `P.combine` x + let sfp = (P.fromAbs . P.dirname $ p') x rsfp <- realpath sfp readFile ff =<< P.parseAbs rsfp return $ SymLink p' fv resolvedSyml x