Commit 5217a74b authored by Max Kellermann's avatar Max Kellermann

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.
parent cccf35d1
...@@ -298,10 +298,18 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept ...@@ -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 mounted_storage->MapUTF8(uri_utf8);
} catch (...) {
/* fallback - not usable but the best we can do */
return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8); if (StringIsEmpty(uri_utf8))
return base_uri;
return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8);
}
} }
const char * const char *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment