From 0b47519d4427a451f4c7d9d1f24ef53b6d36f80d Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 25 Apr 2008 15:53:02 +0000 Subject: [PATCH] use cannonicalizePath in getFilePathMsg. This returns an absolute path and removes the .. indirection --- src/GF/Devel/UseIO.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GF/Devel/UseIO.hs b/src/GF/Devel/UseIO.hs index 3311edb8c..39b8447f7 100644 --- a/src/GF/Devel/UseIO.hs +++ b/src/GF/Devel/UseIO.hs @@ -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