Permalink
Browse files

Canonicalize the current and cached binary paths

This should eliminate an infinite loop bug reported by travitch,
which occurs when a symlink causes the two paths to appear
different even when they point to the same file.
  • Loading branch information...
1 parent 15447df commit 7813af2f25ede12d9482dbb912f7490b2006f204 @willdonnelly committed Aug 6, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 Config/Dyre/Paths.hs
View
@@ -27,7 +27,10 @@ getPaths params@Params{projectName = pName} = do
(False, Just cd) -> cd
let tempBinary = cacheDir </> pName ++ "-" ++ os ++ "-" ++ arch
let configFile = configDir </> pName ++ ".hs"
- return (thisBinary, tempBinary, configFile, cacheDir)
+
+ thisBinary' <- canonicalizePath thisBinary
+ tempBinary' <- canonicalizePath tempBinary
+ return (thisBinary', tempBinary', configFile, cacheDir)
-- | Check if a file exists. If it exists, return Just the modification
-- time. If it doesn't exist, return Nothing.

0 comments on commit 7813af2

Please sign in to comment.