mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09:27 +02:00
amicommon: merged another AROS branch fix, avoid using GetCurrentDirName in do_GetDir since that doesn't work when started from WB
git-svn-id: trunk@28517 -
This commit is contained in:
parent
cba1962284
commit
0a2899573a
@ -84,16 +84,19 @@ begin
|
||||
end;
|
||||
|
||||
procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
|
||||
var tmpbuf: array[0..255] of char;
|
||||
var
|
||||
tmpbuf: array[0..255] of char;
|
||||
lockDir: LongInt;
|
||||
begin
|
||||
checkCTRLC;
|
||||
Dir:='';
|
||||
Dir := '';
|
||||
|
||||
if not GetCurrentDirName(tmpbuf,256) then
|
||||
dosError2InOut(IoErr)
|
||||
else
|
||||
begin
|
||||
Dir:=tmpbuf;
|
||||
SetCodePage(Dir,DefaultFileSystemCodePage,false);
|
||||
end;
|
||||
{ dos.library's GetCurrentDirName() doesn't work when called from
|
||||
Workbench (ie. when the process has no CLI sructure) }
|
||||
{ it also doesn't seem to work when invoked from make on AROS }
|
||||
LockDir := CurrentDir(0);
|
||||
NameFromLock(LockDir, tmpBuf, 256);
|
||||
CurrentDir(LockDir);
|
||||
Dir := tmpBuf;
|
||||
SetCodePage(Dir,DefaultSystemCodePage,false);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user