Skip to content

Commit

Permalink
normalise the input and output file names when pre-processing
Browse files Browse the repository at this point in the history
eg so we don't call cpp with ././src/blah -o ./dist/blah
since those ././ can end up in error messages.
  • Loading branch information
dcoutts committed Aug 4, 2007
1 parent eec66d2 commit 8f4b5f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Distribution/PreProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import Data.Maybe (fromMaybe)
import Data.List (nub)
import System.Directory (removeFile, getModificationTime)
import System.Info (os, arch)
import System.FilePath (splitExtension, (</>), (<.>), takeDirectory)
import System.FilePath (splitExtension, (</>), (<.>), takeDirectory, normalise)

-- |The interface to a preprocessor, which may be implemented using an
-- external program, but need not be. The arguments are the name of
Expand Down Expand Up @@ -137,8 +137,8 @@ mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ())
mkSimplePreProcessor simplePP
(inBaseDir, inRelativeFile)
(outBaseDir, outRelativeFile) verbosity = simplePP inFile outFile verbosity
where inFile = inBaseDir </> inRelativeFile
outFile = outBaseDir </> outRelativeFile
where inFile = normalise (inBaseDir </> inRelativeFile)
outFile = normalise (outBaseDir </> outRelativeFile)

runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity
-> IO ()
Expand Down

0 comments on commit 8f4b5f6

Please sign in to comment.