From e4356b73870ac67242146fd66b3fda4d177e6d26 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 21 Jun 2014 19:25:37 +0200 Subject: m3u: fixed loading symlinked playlists with relative pathes (bug #1055) --- plugins/m3u/m3u.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index ea5a5fba..9c13a9e8 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -21,9 +21,16 @@ 3. This notice may not be removed or altered from any source distribution. */ +#ifdef HAVE_CONFIG_H +# include "../../config.h" +#endif #include #include #include // for ceil +#if HAVE_SYS_SYSLIMITS_H +#include +#endif + #include "../../deadbeef.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } @@ -443,6 +450,12 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab static DB_playItem_t * m3uplug_load (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { + char resolved_fname[PATH_MAX]; + char *res = realpath (fname, resolved_fname); + if (res) { + fname = resolved_fname; + } + const char *ext = strrchr (fname, '.'); if (ext) { ext++; -- cgit v1.2.3