1
0
Fork 0
forked from len0rd/rockbox

Use file_exists instead of duplicating what it does.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17022 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nicolas Pennequin 2008-04-07 17:43:59 +00:00
parent ac313abe87
commit 6ff8f6ae87

View file

@ -2516,7 +2516,6 @@ char* playlist_peek(int steps)
{ {
struct playlist_info* playlist = &current_playlist; struct playlist_info* playlist = &current_playlist;
int seek; int seek;
int fd;
char *temp_ptr; char *temp_ptr;
int index; int index;
bool control_file; bool control_file;
@ -2540,26 +2539,12 @@ char* playlist_peek(int steps)
(workaround for buggy playlist creation tools) */ (workaround for buggy playlist creation tools) */
while (temp_ptr) while (temp_ptr)
{ {
#ifdef HAVE_DIRCACHE if (file_exists(temp_ptr))
if (dircache_is_enabled()) break;
{
if (dircache_get_entry_ptr(temp_ptr))
break;
}
else
#endif
{
fd = open(temp_ptr, O_RDONLY);
if (fd >= 0)
{
close(fd);
break;
}
}
temp_ptr = strchr(temp_ptr+1, '/'); temp_ptr = strchr(temp_ptr+1, '/');
} }
if (!temp_ptr) if (!temp_ptr)
{ {
/* Even though this is an invalid file, we still need to pass a /* Even though this is an invalid file, we still need to pass a