mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:29:14 +02:00
human68k: implemented do_chdir
This commit is contained in:
parent
09397bd542
commit
34519c67a1
@ -106,6 +106,7 @@ const
|
|||||||
SEEK_FROM_END = 2;
|
SEEK_FROM_END = 2;
|
||||||
|
|
||||||
procedure h68kdos_exit; noreturn; syscall $ff00;
|
procedure h68kdos_exit; noreturn; syscall $ff00;
|
||||||
|
function h68kdos_chgdrv(newdrv: word): longint; syscall $ff0e;
|
||||||
function h68kdos_curdrv: longint; syscall $ff17;
|
function h68kdos_curdrv: longint; syscall $ff17;
|
||||||
function h68kdos_gettim2: longint; syscall $ff27;
|
function h68kdos_gettim2: longint; syscall $ff27;
|
||||||
function h68kdos_mkdir(name: pchar): longint; syscall $ff39;
|
function h68kdos_mkdir(name: pchar): longint; syscall $ff39;
|
||||||
|
@ -50,7 +50,39 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure do_ChDir(const s: rawbytestring);
|
procedure do_ChDir(const s: rawbytestring);
|
||||||
|
var
|
||||||
|
ps: rawbytestring;
|
||||||
|
len: longint;
|
||||||
|
curdrive: word;
|
||||||
|
newdrive: word;
|
||||||
|
dosResult: longint;
|
||||||
begin
|
begin
|
||||||
|
ps:=s;
|
||||||
|
DoDirSeparators(ps);
|
||||||
|
len:=Length(ps);
|
||||||
|
|
||||||
|
{ first, handle drive changes }
|
||||||
|
if (len>=2) and (ps[2]=':') then
|
||||||
|
begin
|
||||||
|
curdrive:=h68kdos_curdrv;
|
||||||
|
newdrive:=(ord(ps[1]) and (not 32))-ord('A');
|
||||||
|
if (newdrive <> curdrive) then
|
||||||
|
begin
|
||||||
|
dosResult:=h68kdos_chgdrv(newdrive);
|
||||||
|
if dosResult <= newdrive then
|
||||||
|
begin
|
||||||
|
Error2InOutRes(DOSE_ILGDRV);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if len=2 then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
{ do normal setpath }
|
||||||
|
dosResult:=h68kdos_chdir(PAnsiChar(ps));
|
||||||
|
if dosResult < 0 then
|
||||||
|
Error2InOutRes(dosResult);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user