summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-08-09 11:43:56 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-08-09 11:43:56 +0000
commite2992169088f6206353584284c4eee4a69805c1e (patch)
tree036f802d4dc19eda280c30823ceb320983156780 /apps
parent5dac9119f44014e22db9a9bae38e115a50cc0f2a (diff)
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
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index b42ecb5681..87bac57f0b 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++) {