Change GetDeviceLocal device selection

For `GetDeviceLocal` only consider a device if the full path to the device
matches the first part of the path to match.

The issue was that putting in a file that was not in a sub-path of an existing
mounted device failed. So if the rpcs3 devices are in
D:\DEV\rpcs3\bin and you open D:\DEV\ps3autotests\tests\rsx\primitives\primitives.ppu.elf
it would return
/dev_usb000/ps3autotests\tests\rsx\primitives\primitives.ppu.elf
which resolves to
D:/DEV/rpcs3/bin/dev_usb000/ps3autotests/tests/rsx/primitives/primitives.ppu.elf
and is wrong.

Correct are either /dev_usb000/../../../ps3autotests\tests\rsx\primitives\primitives.ppu.elf
or /hostfs/D:\DEV\ps3autotests\tests\rsx\primitives\primitives.ppu.elf

I chose to resolve without the ".." beyond root, since that just seems wrong
(so it will now return the hostfs version).

Fixes #1090
This commit is contained in:
Peter Tissen 2015-05-21 10:45:40 +02:00
parent 46302084e7
commit 0b0c8723eb
2 changed files with 14 additions and 17 deletions

View file

@ -265,10 +265,7 @@ void Emulator::Load()
if (m_elf_path.empty())
{
if (!GetVFS().GetDeviceLocal(m_path, m_elf_path))
{
m_elf_path = "/host_root/" + m_path; // should be probably app_home
}
GetVFS().GetDeviceLocal(m_path, m_elf_path);
LOG_NOTICE(LOADER, "Elf path: %s", m_elf_path);
}