[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:21:13 UTC 2010


The following commit has been merged in the master branch:
commit 707aff4c5540bb24cb065ee3074e813d7105ea6f
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Mar 9 00:47:05 2007 +0100

    Fixed globbing
    
    Reverted to old FilePath API

diff --git a/src/System/Path/Glob.hs b/src/System/Path/Glob.hs
index ab6fdc1..5d363b8 100644
--- a/src/System/Path/Glob.hs
+++ b/src/System/Path/Glob.hs
@@ -35,9 +35,10 @@ module System.Path.Glob(glob, vGlob) where
 import Data.List.Utils
 import System.IO
 import System.IO.HVFS
-import System.FilePath.Version_0_11
+import System.FilePath
 import Control.Exception
 import System.Path.WildMatch
+import Data.List
 
 hasWild = hasAny "*?["
 
@@ -79,8 +80,12 @@ expandGlob fs fn =
                  else do r <- mapM expandNormalBase dirlist
                          return $ concat r
            
-    where basename = takeBaseName fn
-          dirname = takeDirectory fn
+    where (dirnameslash, basename) = splitFileName fn
+          dirname = case dirnameslash of
+                      "/" -> "/"
+                      x -> if isSuffixOf "/" x
+                              then take (length x - 1) x
+                              else x
           expandWildBase :: FilePath -> IO [FilePath]
           expandWildBase dname =
               do dirglobs <- runGlob fs dname basename

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list