From 4f80a129f13daae72e0463923250534e0d437026 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 30 Nov 2014 00:17:08 +0100 Subject: fs/Charset: return std::string from PathFromUTF8() Don't expose pointer that requires the caller to invoke g_free(), because that's GLib-only. --- src/fs/AllocatedPath.cxx | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/fs/AllocatedPath.cxx') 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 -#endif - -#include - -#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 -- cgit v1.2.3