From 1ee6a78cb727561e75a5d60135bb0cd7956f70b0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 12 Sep 2013 10:02:11 +0200 Subject: Path: add FromUTF8() overload that returns an Error --- src/ConfigPath.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/ConfigPath.cxx') diff --git a/src/ConfigPath.cxx b/src/ConfigPath.cxx index 86f70dfd3..f9236df2a 100644 --- a/src/ConfigPath.cxx +++ b/src/ConfigPath.cxx @@ -53,13 +53,9 @@ ParsePath(const char *path, Error &error) { assert(path != nullptr); - Path path2 = Path::FromUTF8(path); - if (path2.IsNull()) { - error.Format(path_domain, - "Failed to convert path to file system charset: %s", - path); + Path path2 = Path::FromUTF8(path, error); + if (path2.IsNull()) return Path::Null(); - } #ifndef WIN32 if (!g_path_is_absolute(path) && path[0] != '~') { -- cgit v1.2.3