From 7df5ce8c539a826a78249fa0688c05dd9f301214 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 28 May 2009 13:57:06 +0000 Subject: [PATCH] Fix #3189: use System.Win32.getFullPathName --- System/Directory.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/System/Directory.hs b/System/Directory.hs index 86e852f..3455f4d 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -629,15 +629,14 @@ copyFile fromFPath toFPath = -- attempt. canonicalizePath :: FilePath -> IO FilePath canonicalizePath fpath = - withCString fpath $ \pInPath -> - allocaBytes long_path_size $ \pOutPath -> #if defined(mingw32_HOST_OS) - alloca $ \ppFilePart -> - do c_GetFullPathName pInPath (fromIntegral long_path_size) pOutPath ppFilePart + do path <- System.Win32.getFullPathName fpath #else + withCString fpath $ \pInPath -> + allocaBytes long_path_size $ \pOutPath -> do c_realpath pInPath pOutPath -#endif path <- peekCString pOutPath +#endif return (normalise path) -- normalise does more stuff, like upper-casing the drive letter -- 1.7.10.4