Ticket #5221 (closed bug: worksforme)
|Reported by:||igloo||Owned by:||batterseapower|
|Type of failure:||None/Unknown||Difficulty:|
|Test Case:||Blocked By:|
This program now fails:
$ touch `printf "a1\243a"` $ ls -b a* a1\243a $ cat q.hs import Data.List import System.Directory main :: IO () main = do xs <- getDirectoryContents "." let ys = filter ("a" `isPrefixOf`) xs print ys mapM_ removeFile ys $ ghc --make q $ ./q ["a1\61347a"] q: a1�a: removeLink: does not exist (No such file or directory) $ ls -b a* a1\243a $
This program should work unmodified. The fact that it doesn't demonstrates that I need to replace some instances of the Foreign.C.*CString functions with their escape-handling counterparts (withFilePath and friends). Although I fixed this in some libraries I apparently forgot to do so in others. Alternatively, I could change the Foreign.C functions to do the Right Thing with escape characters. This would strictly be in violation of the FFI spec though it would make it vastly more probable that 3rd party libraries would work correctly with strings containing surrogates.
Note: See TracTickets for help on using tickets.