Hi, On Saturday 12 April 2008 12:42, Reimar Döffinger wrote:
On Sat, Apr 12, 2008 at 05:45:59AM +0400, Andrew Savchenko wrote:
I've found that function for filename recoding already exists: filename_recode() in mp_msg.c, so I changed it in order to recode from arbitrary initial encoding to arbitrary final one.
IMO, since filename_recode is not thread safe, it should only be used for _printing_ stuff, never for actually important code, and preferably even that only from as few places as possible.
Yes, original filename_recode() isn't thread safe, but I moved static iconv_t handle out of the filename_recode_common() and, when used for ftp purposes, I save buffer with recoded filename to an external buffer. Moreover in my next patch I will move static buffer for recoded_filename out of filename_recode_common() to filename_recode(). Thus filename_recode_common() will be thread safe completely.