mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-26 19:32:48 +01:00
* FSearch with given path corrected
This commit is contained in:
parent
c0ec0e97c9
commit
103c1d2d52
@ -183,6 +183,28 @@ var i,p1:longint;
|
|||||||
ND: PathStr;
|
ND: PathStr;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{ check if the file specified exists }
|
||||||
|
if OS_Mode = osOS2 then
|
||||||
|
begin
|
||||||
|
New (FStat);
|
||||||
|
ND := NewDir + Path;
|
||||||
|
Handle := $FFFFFFFF;
|
||||||
|
Count := 1;
|
||||||
|
RC := DosFindFirst (ND, Handle, $37, FStat, SizeOf (FStat^),
|
||||||
|
Count, ilStandard);
|
||||||
|
DosFindClose (Handle);
|
||||||
|
Dispose (FStat);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
FindFirst (path,anyfile,s);
|
||||||
|
FindClose (s);
|
||||||
|
RC := DosError;
|
||||||
|
end;
|
||||||
|
if RC = 0 then
|
||||||
|
FSearch := Path
|
||||||
|
else
|
||||||
|
begin
|
||||||
{No wildcards allowed in these things:}
|
{No wildcards allowed in these things:}
|
||||||
if (pos('?',path)<>0) or (pos('*',path)<>0) then
|
if (pos('?',path)<>0) or (pos('*',path)<>0) then
|
||||||
fsearch:=''
|
fsearch:=''
|
||||||
@ -212,14 +234,15 @@ begin
|
|||||||
ND := NewDir + Path;
|
ND := NewDir + Path;
|
||||||
Handle := $FFFFFFFF;
|
Handle := $FFFFFFFF;
|
||||||
Count := 1;
|
Count := 1;
|
||||||
RC := DosFindFirst (ND, Handle, $37, FStat, SizeOf (FStat^),
|
RC := DosFindFirst (ND, Handle, $37, FStat,
|
||||||
Count, ilStandard);
|
SizeOf (FStat^), Count, ilStandard);
|
||||||
DosFindClose (Handle);
|
DosFindClose (Handle);
|
||||||
Dispose (FStat);
|
Dispose (FStat);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
findfirst(newdir+path,anyfile,s);
|
FindFirst (newdir+path,anyfile,s);
|
||||||
RC := DosError;
|
RC := DosError;
|
||||||
|
FindClose (S);
|
||||||
end;
|
end;
|
||||||
if RC = 0 then
|
if RC = 0 then
|
||||||
newdir:=newdir+path
|
newdir:=newdir+path
|
||||||
@ -228,6 +251,7 @@ begin
|
|||||||
until (dirlist='') or (newdir<>'');
|
until (dirlist='') or (newdir<>'');
|
||||||
fsearch:=newdir;
|
fsearch:=newdir;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure getftime(var f;var time:longint);
|
procedure getftime(var f;var time:longint);
|
||||||
@ -1001,7 +1025,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.22 2000-03-12 18:32:17 hajny
|
Revision 1.23 2000-04-18 20:30:02 hajny
|
||||||
|
* FSearch with given path corrected
|
||||||
|
|
||||||
|
Revision 1.22 2000/03/12 18:32:17 hajny
|
||||||
* missing parentheses added
|
* missing parentheses added
|
||||||
|
|
||||||
Revision 1.21 2000/03/05 19:00:37 hajny
|
Revision 1.21 2000/03/05 19:00:37 hajny
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user