[project @ 2000-11-17 13:33:17 by sewardj]
[ghc-hetmet.git] / ghc / compiler / main / DriverUtil.hs
index 7d6e6eb..a8dd667 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.7 2000/11/16 11:39:37 simonmar Exp $
+-- $Id: DriverUtil.hs,v 1.8 2000/11/17 13:33:17 sewardj Exp $
 --
 -- Utils for the driver
 --
@@ -136,6 +136,13 @@ splitFilename f = (reverse (stripDot rev_basename), reverse rev_ext)
         stripDot ('.':xs) = xs
         stripDot xs       = xs
 
+-- "foo/bar/xyzzy.ext" -> ("foo/bar", "xyzzy", ".ext")
+splitFilename3 :: String -> (String,String,String)
+splitFilename3 str
+   = let dir = getdir str
+         (name, ext) = splitFilename (drop (length dir) str)
+     in  (dir, name, ext)
+
 remove_suffix :: Char -> String -> String
 remove_suffix c s
   | null pre  = reverse suf