diff options
Diffstat (limited to '')
-rw-r--r-- | screen_file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/screen_file.c b/screen_file.c index bd60872e6..d83a1870c 100644 --- a/screen_file.c +++ b/screen_file.c @@ -16,10 +16,12 @@ #include "screen.h" #include "screen_file.h" +#define BUFSIZE 1024 static char * list_callback(int index, int *highlight, void *data) { + static char buf[BUFSIZE]; mpd_client_t *c = (mpd_client_t *) data; filelist_entry_t *entry; mpd_InfoEntity *entity; @@ -37,10 +39,12 @@ list_callback(int index, int *highlight, void *data) } if( entity->type==MPD_INFO_ENTITY_TYPE_DIRECTORY ) { - mpd_Directory *dir = entity->info.directory; + char *dirname = utf8_to_locale(dir->path); - return utf8(basename(dir->path)); + strncpy(buf, dirname, BUFSIZE); + free(dirname); + return buf; } else if( entity->type==MPD_INFO_ENTITY_TYPE_SONG ) { |