aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/AllocatedPath.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-30 00:17:08 +0100
committerMax Kellermann <max@duempel.org>2014-11-30 00:28:27 +0100
commit4f80a129f13daae72e0463923250534e0d437026 (patch)
treec7e0a3713cd32b6ac7dbf318c418be79f907c23a /src/fs/AllocatedPath.cxx
parent6987f2ba82ca2205efa5a0ff9088f4555fe607c1 (diff)
downloadmpd-4f80a129f13daae72e0463923250534e0d437026.tar.gz
mpd-4f80a129f13daae72e0463923250534e0d437026.tar.xz
mpd-4f80a129f13daae72e0463923250534e0d437026.zip
fs/Charset: return std::string from PathFromUTF8()
Don't expose pointer that requires the caller to invoke g_free(), because that's GLib-only.
Diffstat (limited to 'src/fs/AllocatedPath.cxx')
-rw-r--r--src/fs/AllocatedPath.cxx21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx
index 65dcff56f..bd026db74 100644
--- a/src/fs/AllocatedPath.cxx
+++ b/src/fs/AllocatedPath.cxx
@@ -24,21 +24,6 @@
#include "util/Error.hxx"
#include "Compiler.h"
-#ifdef HAVE_GLIB
-#include <glib.h>
-#endif
-
-#include <string.h>
-
-#ifdef HAVE_GLIB
-
-inline AllocatedPath::AllocatedPath(Donate, pointer _value)
- :value(_value) {
- g_free(_value);
-}
-
-#endif
-
/* no inlining, please */
AllocatedPath::~AllocatedPath() {}
@@ -46,11 +31,7 @@ AllocatedPath
AllocatedPath::FromUTF8(const char *path_utf8)
{
#ifdef HAVE_FS_CHARSET
- char *path = ::PathFromUTF8(path_utf8);
- if (path == nullptr)
- return AllocatedPath::Null();
-
- return AllocatedPath(Donate(), path);
+ return AllocatedPath(::PathFromUTF8(path_utf8));
#else
return FromFS(path_utf8);
#endif