Check wctomb() availability

This commit is contained in:
Christophe Grenier 2010-11-29 07:38:22 +01:00
parent b1a8589162
commit 3487a5c603
2 changed files with 7 additions and 1 deletions

View file

@ -668,7 +668,7 @@ case "$target" in
;;
esac
AC_CHECK_FUNCS([atexit atoll chdir chmod delscreen dirname dup2 execv ftruncate fsync getcwd geteuid lstat memalign memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strchr strdup strerror strncasecmp strtol touchwin utime vsnprintf])
AC_CHECK_FUNCS([atexit atoll chdir chmod delscreen dirname dup2 execv ftruncate fsync getcwd geteuid lstat memalign memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strchr strdup strerror strncasecmp strtol touchwin utime vsnprintf wctomb])
if test "$ac_cv_func_mkdir" = "no"; then
AC_MSG_ERROR(No mkdir function detected)
fi

View file

@ -81,7 +81,9 @@ file_data_t *dir_fat_aux(const unsigned char*buffer, const unsigned int size, co
unsigned int status;
unsigned int inode;
int utf8=1;
#ifdef HAVE_WCTOMB
wctomb(NULL, 0);
#endif
GetNew:
status=0;
long_slots = 0;
@ -264,7 +266,11 @@ RecEnd:
{
if(utf8 && unicode[i]>0x7f)
{
#ifdef HAVE_WCTOMB
const int sizec=wctomb(&new_file->name[o], unicode[i]);
#else
const int sizec=unicode[i];
#endif
if(sizec <= 0)
{
new_file->name[o]=(char) unicode[i];