use cannonicalizePath in getFilePathMsg. This returns an absolute path and removes the .. indirection

This commit is contained in:
krasimir
2008-04-25 15:53:02 +00:00
parent d4832b4eeb
commit 0b47519d44

View File

@@ -104,8 +104,10 @@ getFilePathMsg msg paths file = get paths where
get (p:ps) = do
let pfile = p </> file
exist <- doesFileExist pfile
if exist then return (Just pfile) else get ps
--- catch (readFileStrict pfile >> return (Just pfile)) (\_ -> get ps)
if not exist
then get ps
else do pfile <- canonicalizePath pfile
return (Just pfile)
readFileIfPath :: [FilePath] -> String -> IOE (FilePath,BS.ByteString)
readFileIfPath paths file = do