X-Git-Url: http://git.jankratochvil.net/?p=captive.git;a=blobdiff_plain;f=src%2Fclient%2Ffuse%2Fop_readdir.c;h=35d14a7a578e67c7167166bd5a839656169a2810;hp=16f920a93e0f87e69e79540cb6d1427f577369a1;hb=a369aa0578f4a98f7b18a18ecc11d266b0f7fe71;hpb=15736d2bd542588c873a156a3d7eefe5efa729e6 diff --git a/src/client/fuse/op_readdir.c b/src/client/fuse/op_readdir.c index 16f920a..35d14a7 100644 --- a/src/client/fuse/op_readdir.c +++ b/src/client/fuse/op_readdir.c @@ -29,6 +29,7 @@ #include "main.h" #include "gnomevfsresult.h" #include "capfuse_captive_file_info_object.h" +#include "utf8.h" /* int (*fuse_fill_dir_t)(void *buf,const char *name,const struct stat *stbuf,off_t off); */ @@ -51,17 +52,20 @@ CaptiveFileInfoObject *captive_file_info_object; &captive_file_info_object))) { /* captive_file_info_object */ struct stat stat; int errint; +char *captive_file_info_object_name; errint=capfuse_captive_file_info_object_to_stat(&stat,captive_file_info_object); if (errint) { g_object_unref(captive_file_info_object); return errint; } + captive_file_info_object_name=capfuse_filename_from_utf8_malloc_errorchecking(captive_file_info_object->p.name); errint=(*fill_dir)( buf, /* buf; opaque */ - captive_file_info_object->p.name, /* name */ + (captive_file_info_object_name ? captive_file_info_object_name : captive_file_info_object->p.name), /* name */ &stat, /* stbuf */ 0); /* off; operation mode 1 - /(*readdir) */ + g_free(captive_file_info_object_name); /* may be NULL */ /* WARNING: (*fill_dir) needs: *captive_file_info_object->p.name */ g_object_unref(captive_file_info_object); if (errint) {