projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2e03cbc
)
Fix #3189: use System.Win32.getFullPathName
author
Simon Marlow
<marlowsd@gmail.com>
Thu, 28 May 2009 13:57:06 +0000
(13:57 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Thu, 28 May 2009 13:57:06 +0000
(13:57 +0000)
System/Directory.hs
patch
|
blob
|
history
diff --git
a/System/Directory.hs
b/System/Directory.hs
index
86e852f
..
3455f4d
100644
(file)
--- a/
System/Directory.hs
+++ b/
System/Directory.hs
@@
-629,15
+629,14
@@
copyFile fromFPath toFPath =
-- attempt.
canonicalizePath :: FilePath -> IO FilePath
canonicalizePath fpath =
-- attempt.
canonicalizePath :: FilePath -> IO FilePath
canonicalizePath fpath =
- withCString fpath $ \pInPath ->
- allocaBytes long_path_size $ \pOutPath ->
#if defined(mingw32_HOST_OS)
#if defined(mingw32_HOST_OS)
- alloca $ \ppFilePart ->
- do c_GetFullPathName pInPath (fromIntegral long_path_size) pOutPath ppFilePart
+ do path <- System.Win32.getFullPathName fpath
#else
#else
+ withCString fpath $ \pInPath ->
+ allocaBytes long_path_size $ \pOutPath ->
do c_realpath pInPath pOutPath
do c_realpath pInPath pOutPath
-#endif
path <- peekCString pOutPath
path <- peekCString pOutPath
+#endif
return (normalise path)
-- normalise does more stuff, like upper-casing the drive letter
return (normalise path)
-- normalise does more stuff, like upper-casing the drive letter