mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
playlist catalog: improve UTF-8 BOM handling. correct length of array passed to create_playlist_list.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24718 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f7ba156b27
commit
35fa12d85f
1 changed files with 23 additions and 25 deletions
|
@ -224,7 +224,7 @@ static int display_playlists(char* playlist, bool view)
|
|||
char* playlists[MAX_PLAYLISTS];
|
||||
struct gui_synclist playlist_lists;
|
||||
|
||||
if (create_playlist_list(playlists, sizeof(playlists),
|
||||
if (create_playlist_list(playlists, MAX_PLAYLISTS,
|
||||
&num_playlists) != 0)
|
||||
return -1;
|
||||
|
||||
|
@ -345,14 +345,12 @@ static int add_to_playlist(const char* playlist, bool new_playlist,
|
|||
{
|
||||
int fd;
|
||||
int result = -1;
|
||||
int flags = O_CREAT|O_WRONLY;
|
||||
|
||||
if (new_playlist)
|
||||
flags |= O_TRUNC;
|
||||
fd = open_utf8(playlist, O_CREAT|O_WRONLY|O_TRUNC);
|
||||
else
|
||||
flags |= O_APPEND;
|
||||
fd = open(playlist, O_CREAT|O_WRONLY|O_APPEND);
|
||||
|
||||
fd = open(playlist, flags);
|
||||
if(fd < 0)
|
||||
return result;
|
||||
|
||||
|
@ -374,7 +372,7 @@ static int add_to_playlist(const char* playlist, bool new_playlist,
|
|||
if(strcasecmp(playlist, sel) == 0)
|
||||
goto exit;
|
||||
|
||||
f = open(sel, O_RDONLY);
|
||||
f = open_utf8(sel, O_RDONLY);
|
||||
if (f < 0)
|
||||
goto exit;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue