aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-14 21:43:41 +0200
committerMax Kellermann <max@duempel.org>2013-10-14 21:43:41 +0200
commit9067da2df8472d6c5871f075654dc0561fbb13f3 (patch)
tree2d12e6d9099d7ba0bf7946764c3141b18ff56457 /src/PlaylistFile.cxx
parent8cf2f52f7acfd22dc85e0ed5ef6bd04cf55d31aa (diff)
downloadmpd-9067da2df8472d6c5871f075654dc0561fbb13f3.tar.gz
mpd-9067da2df8472d6c5871f075654dc0561fbb13f3.tar.xz
mpd-9067da2df8472d6c5871f075654dc0561fbb13f3.zip
Mapper: map_fs_to_utf8() returns std::string
Avoid the conversion to an allocated char*, let the caller decide.
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index e01bc1d26..b7ed10dfa 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -248,13 +248,11 @@ LoadPlaylistFile(const char *utf8path, Error &error)
s = g_strconcat("file://", path.c_str(), NULL);
} else if (!uri_has_scheme(s)) {
- char *path_utf8;
-
- path_utf8 = map_fs_to_utf8(s);
- if (path_utf8 == nullptr)
+ const auto path = map_fs_to_utf8(s);
+ if (path.empty())
continue;
- s = path_utf8;
+ s = g_strdup(path.c_str());
} else {
const auto path = Path::ToUTF8(s);
if (path.empty())