From 760277e096cd35629166367352c108d6ab3b59c2 Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Sat, 18 Sep 2021 21:09:24 -0600 Subject: Dir cache: Fix resume of relative path playlists. Slightly modified from original patch by Fabrice Bellard. Change-Id: I9ae04fa460f0f1b9c616e6f99505d4c5d4358f68 --- apps/playlist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index 49c52a9b7e..0d02be3d48 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1762,9 +1762,8 @@ static ssize_t format_track_path(char *dest, char *src, int buf_length, * to "/<0>/bar" (aka "/bar" at this time). *fingers crossed* * * If any stripped drive spec was absolute, prepend the playlist - * directory's volume spec, or root if none. Relative paths remain - * relative and the playlist's directory fully qualifies them. Absolute - * UNIX-style paths remain unaltered. + * directory's volume spec, or root if none. Absolute UNIX-style paths + * remain unaltered. */ if (path_strip_drive(src, (const char **)&src, true) >= 0 && src[-1] == PATH_SEPCH) @@ -1782,7 +1781,9 @@ static ssize_t format_track_path(char *dest, char *src, int buf_length, if (len >= (size_t)buf_length) return -1; /* buffer too small */ - return len; + path_remove_dot_segments (dest, dest); + + return strlen (dest); } /* -- cgit v1.2.3