From f1c7dc12127fcbad411c28df57e9ce194bd66509 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Feb 2012 12:24:00 -0400 Subject: fix touch and statfs to work on any files in any locale Use withCAString rather than withCString. XXX Actually, this only works in non-unicode locales when presented with unicode characters. Help? --- Utility/Touch.hsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Utility/Touch.hsc') diff --git a/Utility/Touch.hsc b/Utility/Touch.hsc index fd3320cd1..41d3e17b8 100644 --- a/Utility/Touch.hsc +++ b/Utility/Touch.hsc @@ -64,7 +64,7 @@ foreign import ccall "utimensat" touchBoth file atime mtime follow = allocaArray 2 $ \ptr -> - withCString file $ \f -> do + withCAString file $ \f -> do pokeArray ptr [atime, mtime] r <- c_utimensat at_fdcwd f ptr flags when (r /= 0) $ throwErrno "touchBoth" @@ -101,7 +101,7 @@ foreign import ccall "lutimes" touchBoth file atime mtime follow = allocaArray 2 $ \ptr -> - withCString file $ \f -> do + withCAString file $ \f -> do pokeArray ptr [atime, mtime] r <- syscall f ptr if (r /= 0) -- cgit v1.2.3