|
@@ -233,6 +233,8 @@ end;
|
|
function MatchFirst(pat : PChar;
|
|
function MatchFirst(pat : PChar;
|
|
anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchfirst';
|
|
anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchfirst';
|
|
var
|
|
var
|
|
|
|
+ fib_area: array[1..sizeof(TFileInfoBlock) + sizeof(longint)] of byte;
|
|
|
|
+ fib: pfileinfoblock;
|
|
p: PChar;
|
|
p: PChar;
|
|
len: LongInt;
|
|
len: LongInt;
|
|
Path,FileN: AnsiString;
|
|
Path,FileN: AnsiString;
|
|
@@ -240,7 +242,6 @@ var
|
|
i: Integer;
|
|
i: Integer;
|
|
newLock: boolean;
|
|
newLock: boolean;
|
|
DirLock: BPTR;
|
|
DirLock: BPTR;
|
|
- ib: TFileInfoBlock;
|
|
|
|
Res: LongInt;
|
|
Res: LongInt;
|
|
NChain: PAChain;
|
|
NChain: PAChain;
|
|
begin
|
|
begin
|
|
@@ -290,8 +291,10 @@ begin
|
|
MatchFirst := -1;
|
|
MatchFirst := -1;
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+ fib:=align(@fib_area[1],sizeof(longint));
|
|
// examine the dir to get the fib for ExNext
|
|
// examine the dir to get the fib for ExNext
|
|
- if Examine(DirLock, @ib) = 0 then
|
|
|
|
|
|
+ if Examine(DirLock, fib) = 0 then
|
|
begin
|
|
begin
|
|
MatchFirst := -1;
|
|
MatchFirst := -1;
|
|
if newLock then
|
|
if newLock then
|
|
@@ -302,7 +305,7 @@ begin
|
|
// guess it's not meant that way but works
|
|
// guess it's not meant that way but works
|
|
repeat
|
|
repeat
|
|
// get next dir entry
|
|
// get next dir entry
|
|
- Res := ExNext(DirLock, @ib);
|
|
|
|
|
|
+ Res := ExNext(DirLock, fib);
|
|
// nothing nore found -> exit
|
|
// nothing nore found -> exit
|
|
if Res = 0 then
|
|
if Res = 0 then
|
|
break;
|
|
break;
|
|
@@ -327,7 +330,7 @@ begin
|
|
NChain^.an_Parent := Pointer(Anchor);
|
|
NChain^.an_Parent := Pointer(Anchor);
|
|
end;
|
|
end;
|
|
// copy the fileinfoblock into the chain
|
|
// copy the fileinfoblock into the chain
|
|
- Move(ib, NChain^.an_Info, SizeOf(TFileInfoBlock));
|
|
|
|
|
|
+ Move(fib, NChain^.an_Info, SizeOf(TFileInfoBlock));
|
|
end;
|
|
end;
|
|
until Res = 0; // useless... we jump out earlier
|
|
until Res = 0; // useless... we jump out earlier
|
|
//
|
|
//
|