1
0
Fork 0
forked from len0rd/rockbox

Improved responsiveness for dirplay, plus fixed a bug that could cause a file handle leak, and sometimes playlist loading problems

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3518 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2003-04-08 02:05:14 +00:00
parent e67ec3454e
commit 570f16fd6d

View file

@ -490,18 +490,21 @@ char* playlist_peek(int steps)
/* remove bogus dirs from beginning of path
(workaround for buggy playlist creation tools) */
while (buf)
if(!playlist.in_ram)
{
fd = open(buf, O_RDONLY);
if (fd > 0)
while (buf)
{
close(fd);
break;
fd = open(buf, O_RDONLY);
if (fd >= 0)
{
close(fd);
break;
}
buf = strchr(buf+1, '/');
}
buf = strchr(buf+1, '/');
}
if (!buf)
{
/* Even though this is an invalid file, we still need to pass a file