From 1004890e253453faba81126028986f075e5fc5e7 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 13 Apr 2004 04:59:57 +0000 Subject: lots of fsCharset, utf8/ascii converting clean-up and robustness stuff Also, if fsCharsetToUtf8 can't convert to valid UTF-8, then don't add it to the db, this way clients don't have to worry about weirdness and it will force ppl to convert it. git-svn-id: https://svn.musicpd.org/mpd/trunk@711 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/ls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ls.c') diff --git a/src/ls.c b/src/ls.c index a47f64d74..d461109d5 100644 --- a/src/ls.c +++ b/src/ls.c @@ -46,6 +46,7 @@ int lsPlaylists(FILE * fp, char * utf8path) { struct stat st; struct dirent * ent; char * dup; + char * utf8; char s[MAXPATHLEN+1]; List * list = NULL; ListNode * node = NULL; @@ -78,8 +79,9 @@ int lsPlaylists(FILE * fp, char * utf8path) { if(list==NULL) list = makeList(NULL); dup = strdup(ent->d_name); dup[suff] = '\0'; - insertInList(list, - fsCharsetToUtf8(dup),NULL); + if((utf8 = fsCharsetToUtf8(dup))) { + insertInList(list,utf8,NULL); + } free(dup); } } -- cgit v1.2.3