X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverUtil.hs;h=484c024f07fb2434ef3f1792c49ac4544fc72b6c;hb=b89ad0e9ba8633987a0163aa94fed82f7cd56c67;hp=f1d61e4acfa3c35c2a72d13fab20b3264db860a0;hpb=df87e59ebe63776ef33b2587b50930baf9614931;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs index f1d61e4..484c024 100644 --- a/ghc/compiler/main/DriverUtil.hs +++ b/ghc/compiler/main/DriverUtil.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverUtil.hs,v 1.44 2004/09/30 10:37:11 simonpj Exp $ +-- $Id: DriverUtil.hs,v 1.45 2004/10/03 16:28:06 panne Exp $ -- -- Utils for the driver -- @@ -15,8 +15,8 @@ module DriverUtil ( split, add, addNoDups, Suffix, splitFilename, getFileSuffix, splitFilename3, remove_suffix, split_longest_prefix, - replaceFilenameSuffix, directoryOf, replaceFilenameDirectory, - remove_spaces, escapeSpaces, + replaceFilenameSuffix, directoryOf, filenameOf, + replaceFilenameDirectory, remove_spaces, escapeSpaces, ) where #include "../includes/ghcconfig.h" @@ -212,6 +212,11 @@ replaceFilenameSuffix s suf = remove_suffix '.' s ++ suf directoryOf :: FilePath -> String directoryOf = fst . splitFilenameDir +-- filenameOf strips the directory off the input string, returning +-- the filename. +filenameOf :: FilePath -> String +filenameOf = snd . splitFilenameDir + replaceFilenameDirectory :: FilePath -> String -> FilePath replaceFilenameDirectory s dir = dir ++ '/':drop_longest_prefix s isPathSeparator