From: Simon Marlow Date: Thu, 28 May 2009 13:57:06 +0000 (+0000) Subject: Fix #3189: use System.Win32.getFullPathName X-Git-Tag: 2009-06-25~6 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=7df5ce8c539a826a78249fa0688c05dd9f301214 Fix #3189: use System.Win32.getFullPathName --- 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