Path: add FromUTF8() overload that returns an Error

This commit is contained in:
Max Kellermann
2013-09-12 10:02:11 +02:00
parent bf4ee48efa
commit 1ee6a78cb7
4 changed files with 26 additions and 8 deletions

View File

@@ -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] != '~') {