aboutsummaryrefslogtreecommitdiffstats
path: root/screen_file.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-19 19:15:43 +0000
committerKalle Wallin <kaw@linux.se>2004-03-19 19:15:43 +0000
commita48c2fe2c2d13fbc879a6b5111fc9f3c866ac5b3 (patch)
tree8a5ff0674412243fd2610f0c0b3f21cd6e176506 /screen_file.c
parent526b460e750f52f5b9b04df72b6601fe4c1fd5f7 (diff)
downloadmpd-a48c2fe2c2d13fbc879a6b5111fc9f3c866ac5b3.tar.gz
mpd-a48c2fe2c2d13fbc879a6b5111fc9f3c866ac5b3.tar.xz
mpd-a48c2fe2c2d13fbc879a6b5111fc9f3c866ac5b3.zip
Added iconv support
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@308 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--screen_file.c8
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 )
{