[commit: packages/filepath] master: Inline call to joinDrive in combineAlways (aaa3efb)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:35:14 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/aaa3efbc1a8d75e3659dd4580ec5e7581c62f997

>---------------------------------------------------------------

commit aaa3efbc1a8d75e3659dd4580ec5e7581c62f997
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Thu Oct 23 19:05:53 2014 +0200

    Inline call to joinDrive in combineAlways
    
    The first 3 guards of both functions are the same, so copy-paste only the last
    guard of joinDrive into combineAlways.


>---------------------------------------------------------------

aaa3efbc1a8d75e3659dd4580ec5e7581c62f997
 System/FilePath/Internal.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs
index 1e2cdc9..8e54138 100644
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@ -602,7 +602,9 @@ combineAlways :: FilePath -> FilePath -> FilePath
 combineAlways a b | null a = b
                   | null b = a
                   | hasTrailingPathSeparator a = a ++ b
-                  | isDrive a = joinDrive a b
+                  | isDrive a = case a of
+                      [a1,':'] | isWindows && isLetter a1 -> a ++ b
+                      _ -> a ++ [pathSeparator] ++ b
                   | otherwise = a ++ [pathSeparator] ++ b
 
 



More information about the ghc-commits mailing list