From e605786b2a737246e5813b5af1a910a0797f36de Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 10 Sep 2006 10:59:51 +0000 Subject: Patch #5770 by Dominik Riebeling: Skip BOM in playlists. Add '.m3u8' as a supported playlist extension. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10917 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/playlist.c') diff --git a/apps/playlist.c b/apps/playlist.c index aa84bb090f..2f0895a590 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -501,6 +501,14 @@ static int add_indices_to_playlist(struct playlist_info* playlist, p = (unsigned char *)buffer; + /* utf8 BOM at beginning of file? */ + if(i == 0 && nread > 3 + && *p == 0xef && *(p+1) == 0xbb && *(p+2) == 0xbf) { + nread -= 3; + p += 3; + i += 3; + } + for(count=0; count < nread; count++,p++) { /* Are we on a new line? */ -- cgit v1.2.3