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:
Max Kellermann 2018-06-05 22:01:28 +02:00
parent cccf35d140
commit 5217a74b7f
1 changed files with 11 additions and 3 deletions

View File

@ -298,10 +298,18 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept
{
assert(uri_utf8 != nullptr);
if (StringIsEmpty(uri_utf8))
return base_uri;
try {
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 *