summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2008-04-07 17:43:59 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2008-04-07 17:43:59 +0000
commit6ff8f6ae87fb1713675fc07bdb5c5e24485b250f (patch)
tree1c96e69e6d2b656bf86113254cf93174137adc97
parentac313abe8761dab288e80ef65e4f42451c469bee (diff)
Use file_exists instead of duplicating what it does.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17022 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index e19690f8ab..373d2d534a 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -2516,7 +2516,6 @@ char* playlist_peek(int steps)
{
struct playlist_info* playlist = &current_playlist;
int seek;
- int fd;
char *temp_ptr;
int index;
bool control_file;
@@ -2540,26 +2539,12 @@ char* playlist_peek(int steps)
(workaround for buggy playlist creation tools) */
while (temp_ptr)
{
-#ifdef HAVE_DIRCACHE
- if (dircache_is_enabled())
- {
- if (dircache_get_entry_ptr(temp_ptr))
- break;
- }
- else
-#endif
- {
- fd = open(temp_ptr, O_RDONLY);
- if (fd >= 0)
- {
- close(fd);
- break;
- }
- }
-
+ if (file_exists(temp_ptr))
+ break;
+
temp_ptr = strchr(temp_ptr+1, '/');
}
-
+
if (!temp_ptr)
{
/* Even though this is an invalid file, we still need to pass a