From 6ea0f61e30e6ce8d75556f1af9da20ebc13f0eb0 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 31 Jul 2014 16:10:04 +0200 Subject: added support for uppercase .CUE extension --- playlist.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/playlist.c b/playlist.c index 2efc86c2..4132fd99 100644 --- a/playlist.c +++ b/playlist.c @@ -1249,17 +1249,28 @@ plt_insert_cue (playlist_t *plt, playItem_t *after, playItem_t *origin, int nums pl_unlock (); strcpy (cuename+len, ".cue"); DB_FILE *fp = vfs_fopen (cuename); + if (!fp) { + strcpy (cuename+len, ".CUE"); + fp = vfs_fopen (cuename); + } if (!fp) { char *ptr = cuename + len-1; while (ptr >= cuename && *ptr != '.') { ptr--; } + if (ptr < cuename) { + return NULL; + } strcpy (ptr+1, "cue"); fp = vfs_fopen (cuename); if (!fp) { - return NULL; + strcpy (ptr+1, "CUE"); + fp = vfs_fopen (cuename); } } + if (!fp) { + return NULL; + } size_t sz = vfs_fgetlength (fp); if (sz == 0) { vfs_fclose (fp); -- cgit v1.2.3