aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongPrint.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-23 21:38:07 +0200
committerMax Kellermann <max@duempel.org>2013-10-23 21:58:44 +0200
commit3d12f8d2466d6a000bb116b4363a695c862ab52d (patch)
tree21d7e2010685edf9ed8254aeff32c56cb7a8f3df /src/SongPrint.cxx
parentc3e720279c89a56b9bbdc46cc6d8c02aefb10ed4 (diff)
downloadmpd-3d12f8d2466d6a000bb116b4363a695c862ab52d.tar.gz
mpd-3d12f8d2466d6a000bb116b4363a695c862ab52d.tar.xz
mpd-3d12f8d2466d6a000bb116b4363a695c862ab52d.zip
UriUtil: uri_remove_auth() returns std::string
Diffstat (limited to 'src/SongPrint.cxx')
-rw-r--r--src/SongPrint.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx
index 721fa1b1a..ea164d02b 100644
--- a/src/SongPrint.cxx
+++ b/src/SongPrint.cxx
@@ -27,8 +27,6 @@
#include "Client.hxx"
#include "util/UriUtil.hxx"
-#include <glib.h>
-
void
song_print_uri(Client &client, const Song &song)
{
@@ -36,17 +34,13 @@ song_print_uri(Client &client, const Song &song)
client_printf(client, "%s%s/%s\n", SONG_FILE,
song.parent->GetPath(), song.uri);
} else {
- char *allocated;
- const char *uri;
-
- uri = allocated = uri_remove_auth(song.uri);
- if (uri == NULL)
- uri = song.uri;
+ const char *uri = song.uri;
+ const std::string allocated = uri_remove_auth(uri);
+ if (!allocated.empty())
+ uri = allocated.c_str();
client_printf(client, "%s%s\n", SONG_FILE,
map_to_relative_path(uri));
-
- g_free(allocated);
}
}