diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-07-31 16:10:04 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-07-31 16:10:24 +0200 |
commit | 6ea0f61e30e6ce8d75556f1af9da20ebc13f0eb0 (patch) | |
tree | 716759b208f0ca06faeefabfda624066990a46d5 | |
parent | efb0a36ae96456b3d66dd34cf4ad136c59dc1f85 (diff) |
added support for uppercase .CUE extension
-rw-r--r-- | playlist.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1250,16 +1250,27 @@ plt_insert_cue (playlist_t *plt, playItem_t *after, playItem_t *origin, int nums 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); |