rtl/amiga: in legacy MatchFirst, revert back to the original directory if we used CurrentDir(0), otherwise MatchFirst() will change the directory to SYS: (0 lock is a shortcut to the boot volume)

This commit is contained in:
Karoly Balogh 2021-12-27 11:52:01 +01:00
parent 8a63e7ee5a
commit 27e9377a3a

View File

@ -271,7 +271,11 @@ begin
// if no path is given use the current working dir, or try to lock the dir
if Path = '' then
DirLock := CurrentDir(0)
begin
DirLock := CurrentDir(0);
if DirLock <> 0 then
CurrentDir(DirLock);
end
else
DirLock := Lock(PChar(Path), ACCESS_READ);
//