diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-21 19:25:37 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-21 19:26:08 +0200 |
commit | e4356b73870ac67242146fd66b3fda4d177e6d26 (patch) | |
tree | 9c467cf8102394981b3fe636fc6a487a8dec0455 | |
parent | 6de76a3d74f0626a533884b894e14bed5894807f (diff) |
m3u: fixed loading symlinked playlists with relative pathes (bug #1055)
-rw-r--r-- | plugins/m3u/m3u.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 <string.h> #include <stdlib.h> #include <math.h> // for ceil +#if HAVE_SYS_SYSLIMITS_H +#include <sys/syslimits.h> +#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++; |