aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_print.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-07-25 13:18:57 +0200
committerMax Kellermann <max@duempel.org>2010-07-25 13:28:39 +0200
commitb233c145fa28f2a9e90a40993bc35f408d256e08 (patch)
tree81a4520fde88423f5654c3c97fc748ca7065f44e /src/song_print.c
parent9de5bb9e23915f847b59d32d9e857c45974b01d7 (diff)
downloadmpd-b233c145fa28f2a9e90a40993bc35f408d256e08.tar.gz
mpd-b233c145fa28f2a9e90a40993bc35f408d256e08.tar.xz
mpd-b233c145fa28f2a9e90a40993bc35f408d256e08.zip
{queue,song}_print: print relative paths if possible
If a song with an absolute path points inside the music directory, print only the relative part. This happens when partial songs from a playlist file were loaded.
Diffstat (limited to 'src/song_print.c')
-rw-r--r--src/song_print.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/song_print.c b/src/song_print.c
index 11b241fbc..16239e03b 100644
--- a/src/song_print.c
+++ b/src/song_print.c
@@ -25,6 +25,7 @@
#include "tag_print.h"
#include "client.h"
#include "uri.h"
+#include "mapper.h"
void
song_print_uri(struct client *client, struct song *song)
@@ -40,7 +41,8 @@ song_print_uri(struct client *client, struct song *song)
if (uri == NULL)
uri = song->uri;
- client_printf(client, "%s%s\n", SONG_FILE, uri);
+ client_printf(client, "%s%s\n", SONG_FILE,
+ map_to_relative_path(uri));
g_free(allocated);
}