diff options
Diffstat (limited to 'apps/cuesheet.c')
| -rw-r--r-- | apps/cuesheet.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c index ba6bc96..dcdba9f 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -91,22 +91,20 @@ bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path) dot = strrchr(cuepath, '.'); strcpy(dot, ".cue"); - int fd = open(cuepath,O_RDONLY); - if (fd < 0) + if (!file_exists(cuepath)) { strcpy(cuepath, CUE_DIR); strcat(cuepath, slash); char *dot = strrchr(cuepath, '.'); strcpy(dot, ".cue"); - fd = open(cuepath,O_RDONLY); - if (fd < 0) + if (!file_exists(cuepath)) { if (found_cue_path) found_cue_path = NULL; return false; } } - close(fd); + if (found_cue_path) strncpy(found_cue_path, cuepath, MAX_PATH); return true; |