From deb017e17f9cf0da499c6df692b332535b7064e7 Mon Sep 17 00:00:00 2001 From: David Walters Date: Fri, 8 Dec 2017 23:50:00 +0000 Subject: [PATCH] On Windows builds, don't use case sensitive path comparisons when pushing to a playlist. --- playlist.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/playlist.c b/playlist.c index 5ccc40cd2e..7406e75df0 100644 --- a/playlist.c +++ b/playlist.c @@ -309,9 +309,17 @@ bool playlist_push(playlist_t *playlist, for (i = 0; i < playlist->size; i++) { struct playlist_entry tmp; - bool equal_path = (!path && !playlist->entries[i].path) || + bool equal_path; + + equal_path = (!path && !playlist->entries[i].path) || (path && playlist->entries[i].path && - string_is_equal(path,playlist->entries[i].path)); +#ifdef _WIN32 + /*prevent duplicates on case-insensitive operating systems*/ + string_is_equal_noncase(path,playlist->entries[i].path) +#else + string_is_equal(path,playlist->entries[i].path) +#endif + ); /* Core name can have changed while still being the same core. * Differentiate based on the core path only. */