UriUtil: uri_remove_auth() returns std::string

This commit is contained in:
Max Kellermann
2013-10-23 21:38:07 +02:00
parent c3e720279c
commit 3d12f8d246
6 changed files with 25 additions and 38 deletions

View File

@@ -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);
}
}