Path::FromUTF8() returns nulled instance on error, add error handling where required
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user