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.tar.gz
rockbox-570f16fd6d736b6927cc4b007767e0cba908baf2.zip
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 058dcfe88c..165c13847b 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -490,18 +490,21 @@ char* playlist_peek(int steps)
490 490
491 /* remove bogus dirs from beginning of path 491 /* remove bogus dirs from beginning of path
492 (workaround for buggy playlist creation tools) */ 492 (workaround for buggy playlist creation tools) */
493 while (buf) 493 if(!playlist.in_ram)
494 { 494 {
495 fd = open(buf, O_RDONLY); 495 while (buf)
496 if (fd > 0)
497 { 496 {
498 close(fd); 497 fd = open(buf, O_RDONLY);
499 break; 498 if (fd >= 0)
499 {
500 close(fd);
501 break;
502 }
503
504 buf = strchr(buf+1, '/');
500 } 505 }
501
502 buf = strchr(buf+1, '/');
503 } 506 }
504 507
505 if (!buf) 508 if (!buf)
506 { 509 {
507 /* Even though this is an invalid file, we still need to pass a file 510 /* Even though this is an invalid file, we still need to pass a file