From e2992169088f6206353584284c4eee4a69805c1e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 9 Aug 2008 11:43:56 +0000 Subject: Fix problem with utf8 playlists containing a BOM breaking all entries but the first -- the index calculation needs to take the BOM size into account. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18225 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index b42ecb5..87bac57 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -533,9 +533,9 @@ static int add_indices_to_playlist(struct playlist_info* playlist, playlist->fd = open_utf8(playlist->filename, O_RDONLY); if(playlist->fd < 0) return -1; /* failure */ - if(lseek(playlist->fd, 0, SEEK_CUR) > 0) + if((i = lseek(playlist->fd, 0, SEEK_CUR)) > 0) playlist->utf8 = true; /* Override any earlier indication. */ - + gui_syncsplash(0, ID2P(LANG_WAIT)); if (!buffer) @@ -550,7 +550,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist, buffer = (char *)audio_get_buffer(false, &buflen); #endif } - + store_index = true; while(1) @@ -559,7 +559,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist, /* Terminate on EOF */ if(nread <= 0) break; - + p = (unsigned char *)buffer; for(count=0; count < nread; count++,p++) { -- cgit v1.1