summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-04-08 02:05:14 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-04-08 02:05:14 +0000
commit570f16fd6d736b6927cc4b007767e0cba908baf2 (patch)
treebafdac9facef5ef3c9219669d3ddfdd3fe995579 /apps
parente67ec3454ea04ad3afc981c24db671cab9aa0a18 (diff)
downloadrockbox-570f16fd6d736b6927cc4b007767e0cba908baf2.zip
rockbox-570f16fd6d736b6927cc4b007767e0cba908baf2.tar.gz
rockbox-570f16fd6d736b6927cc4b007767e0cba908baf2.tar.bz2
rockbox-570f16fd6d736b6927cc4b007767e0cba908baf2.tar.xz
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
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 058dcfe..165c138 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -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