From fafb7d2e8c703bf65445665729be0ad449c64ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bo=20St=C3=A5le=20Kopperud?= Date: Fri, 15 May 2026 13:46:15 +0200 Subject: [PATCH] dos: strip volume specifier in getpacketinfo Strip the volume/assign specifier before handing the name to the filesystem handler. GetDeviceProc() resolves the prefix to the correct handler + base lock, and the handler expects the remaining relative path - not the original name with a ':' still in it. Lock() in lock.c does the same. Without this, handlers whose path parser treats ':' as a "reset to root" marker (e.g. fat) end up searching the wrong directory and returning OBJECT_NOT_FOUND. --- rom/dos/packethelper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rom/dos/packethelper.c b/rom/dos/packethelper.c index 21d3f6dc69a..dfa6dda7d55 100644 --- a/rom/dos/packethelper.c +++ b/rom/dos/packethelper.c @@ -37,7 +37,9 @@ BOOL getpacketinfo(struct DosLibrary *DOSBase, CONST_STRPTR name, struct PacketH phs->name = bstrname; return TRUE; } else { /* ":" */ - BSTR bstrname = C2BSTR(name); + /* Strip the volume/assign specifier before handing the name to the filesystem handler. */ + CONST_STRPTR filename = strchr(name, ':') + 1; + BSTR bstrname = C2BSTR(filename); struct DevProc *dvp = NULL; if ((dvp = GetDeviceProc(name, dvp))) { phs->name = bstrname; @@ -46,6 +48,7 @@ BOOL getpacketinfo(struct DosLibrary *DOSBase, CONST_STRPTR name, struct PacketH phs->dp = dvp; return TRUE; } + FREEC2BSTR(bstrname); } return FALSE; }