From e98e2a0b07363132707146f571d3411e3e1b8076 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Sun, 27 Jan 2013 13:26:17 +0600 Subject: Path::FromUTF8() returns nulled instance on error, add error handling where required --- src/fs/Path.cxx | 3 --- src/fs/Path.hxx | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src/fs') diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx index 7664e3ac0..cb808b36c 100644 --- a/src/fs/Path.cxx +++ b/src/fs/Path.cxx @@ -82,9 +82,6 @@ Path Path::FromUTF8(const char *path_utf8) p = g_convert(path_utf8, -1, fs_charset.c_str(), "utf-8", NULL, NULL, NULL); - if (p == NULL) - /* fall back to UTF-8 */ - p = g_strdup(path_utf8); return Path(Donate(), p); } diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index b9754b5c5..8635d12a9 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -144,10 +144,7 @@ public: /** * Convert a UTF-8 C string to a #Path instance. - * Returns a duplicate of the UTF-8 string on failure. - * - * TODO: return a "nulled" instance on error and add checks to - * all callers + * Returns return a "nulled" instance on error. */ gcc_pure static Path FromUTF8(const char *path_utf8); -- cgit v1.2.3