Commit a987176f authored by Bernd Brassel's avatar Bernd Brassel
Browse files

nubbing the right way

parent 16ae3489
......@@ -12,6 +12,7 @@ import MetaProgramming.FlatCurry(readFlatCurry)
import Names
import KicsSubdir
getOptions :: IO (Options,State)
getOptions = do
(opts,state) <- readConfig
......@@ -375,7 +376,9 @@ safeReadFlat opts s = do
warning fn path [] = fail ("module "++fn++" not found in path "++path)
warning _ _ (f:fs) = do
mapM_ (safeIO . putStrLn) (map ("further file found (but ignored) "++) fs)
mapM_ (safeIO . putStrLn)
(map (\f' -> "further file found (but ignored) "++f'
++" taking "++f++" instead") fs)
return f
......
......@@ -4,7 +4,7 @@ import System.Directory
import System.FilePath
import System.Time (ClockTime)
import Control.Monad (when)
import List (intersperse,nub)
import List (intersperse,nubBy)
curDirPath :: FilePath
curDirPath = "."
......@@ -118,9 +118,9 @@ findFileInPath fn path = do
if any isPathSeparator fn
then findFile fn
else do
let fs = map (++fn) (nub path)
let fs = nubBy equalFilePath $ map (++fn) path
founds <- mapM findFile fs
return (concat founds)
return (nubBy equalFilePath $ concat founds)
where
findFile = onExistingFileDo doesExist
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment