[project @ 2001-04-30 09:40:16 by simonmar]
authorsimonmar <unknown>
Mon, 30 Apr 2001 09:40:16 +0000 (09:40 +0000)
committersimonmar <unknown>
Mon, 30 Apr 2001 09:40:16 +0000 (09:40 +0000)
Reverse the directory list when building the home package directory
cache, so that earlier entries override later ones.

ghc/compiler/main/Finder.lhs

index c9ce6a1..f805654 100644 (file)
@@ -84,7 +84,7 @@ maybeHomeModule mod_name = do
                   contents <- softGetDirectoryContents path
                    let clean_contents = filter isUsefulFile contents
                   return (addListToFM fm (zip clean_contents (repeat path)))
-          home_map <- foldM extendFM emptyFM home_imports
+          home_map <- foldM extendFM emptyFM (reverse home_imports)
           writeIORef v_HomeDirCache (Just home_map)
           return home_map