Permalink
Browse files

Normalise, too, when making absolute paths.

Otherwise, we might end up with things like `/foo/./bar`.
  • Loading branch information...
1 parent f652e87 commit 3272e50490d84f2e6e03750ebffabae895abb882 @nominolo nominolo committed Mar 13, 2009
Showing with 4 additions and 3 deletions.
  1. +3 −2 src/Scion/Session.hs
  2. +1 −1 src/Scion/Types/Notes.hs
View
@@ -343,8 +343,9 @@ loadComponent comp = do
modifySessionState $ \s -> s { lastCompResult = rslt }
return rslt
where
- maybe_set_working_dir (File f) =
- let dir = dropFileName f in
+ maybe_set_working_dir (File f) = do
+ wd <- liftIO $ getCurrentDirectory
+ let dir = normalise $ wd </> dropFileName f
setWorkingDir dir
maybe_set_working_dir _ = do
dir <- cabalProjectRoot
View
@@ -59,7 +59,7 @@ mkAbsFilePath :: FilePath -- ^ base directory (must be absolute)
-> FilePath -- ^ absolute or relative
-> AbsFilePath
mkAbsFilePath baseDir dir
- | isAbsolute baseDir = AFP $ baseDir </> dir
+ | isAbsolute baseDir = AFP $ normalise $ baseDir </> dir
| otherwise =
error "mkAbsFilePath: first argument must be an absolute path"

0 comments on commit 3272e50

Please sign in to comment.