diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-07 17:43:59 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-07 17:43:59 +0000 |
commit | 6ff8f6ae87fb1713675fc07bdb5c5e24485b250f (patch) | |
tree | 1c96e69e6d2b656bf86113254cf93174137adc97 | |
parent | ac313abe8761dab288e80ef65e4f42451c469bee (diff) | |
download | rockbox-6ff8f6ae87fb1713675fc07bdb5c5e24485b250f.tar.gz rockbox-6ff8f6ae87fb1713675fc07bdb5c5e24485b250f.zip |
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.c | 23 |
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) | |||
2516 | { | 2516 | { |
2517 | struct playlist_info* playlist = ¤t_playlist; | 2517 | struct playlist_info* playlist = ¤t_playlist; |
2518 | int seek; | 2518 | int seek; |
2519 | int fd; | ||
2520 | char *temp_ptr; | 2519 | char *temp_ptr; |
2521 | int index; | 2520 | int index; |
2522 | bool control_file; | 2521 | bool control_file; |
@@ -2540,26 +2539,12 @@ char* playlist_peek(int steps) | |||
2540 | (workaround for buggy playlist creation tools) */ | 2539 | (workaround for buggy playlist creation tools) */ |
2541 | while (temp_ptr) | 2540 | while (temp_ptr) |
2542 | { | 2541 | { |
2543 | #ifdef HAVE_DIRCACHE | 2542 | if (file_exists(temp_ptr)) |
2544 | if (dircache_is_enabled()) | 2543 | break; |
2545 | { | 2544 | |
2546 | if (dircache_get_entry_ptr(temp_ptr)) | ||
2547 | break; | ||
2548 | } | ||
2549 | else | ||
2550 | #endif | ||
2551 | { | ||
2552 | fd = open(temp_ptr, O_RDONLY); | ||
2553 | if (fd >= 0) | ||
2554 | { | ||
2555 | close(fd); | ||
2556 | break; | ||
2557 | } | ||
2558 | } | ||
2559 | |||
2560 | temp_ptr = strchr(temp_ptr+1, '/'); | 2545 | temp_ptr = strchr(temp_ptr+1, '/'); |
2561 | } | 2546 | } |
2562 | 2547 | ||
2563 | if (!temp_ptr) | 2548 | if (!temp_ptr) |
2564 | { | 2549 | { |
2565 | /* Even though this is an invalid file, we still need to pass a | 2550 | /* Even though this is an invalid file, we still need to pass a |