storage/udisks: return file path in MapUTF8()
The absolute udisks:// URI is not usable with InputStream::Open(), and thus we need to return the LocalStorage::MapUTF8() return value instead.
This commit is contained in:
parent
cccf35d140
commit
5217a74b7f
|
@ -298,10 +298,18 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept
|
||||||
{
|
{
|
||||||
assert(uri_utf8 != nullptr);
|
assert(uri_utf8 != nullptr);
|
||||||
|
|
||||||
if (StringIsEmpty(uri_utf8))
|
try {
|
||||||
return base_uri;
|
const_cast<UdisksStorage *>(this)->MountWait();
|
||||||
|
|
||||||
return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8);
|
return mounted_storage->MapUTF8(uri_utf8);
|
||||||
|
} catch (...) {
|
||||||
|
/* fallback - not usable but the best we can do */
|
||||||
|
|
||||||
|
if (StringIsEmpty(uri_utf8))
|
||||||
|
return base_uri;
|
||||||
|
|
||||||
|
return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
Loading…
Reference in New Issue