mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-09 04:27:25 +01:00
parent
65e9ad8591
commit
c424f27291
@ -27,9 +27,11 @@
|
|||||||
// Start with checking the file in the current directory
|
// Start with checking the file in the current directory
|
||||||
Result:=Name;
|
Result:=Name;
|
||||||
temp:=SetDirSeparators(DirList);
|
temp:=SetDirSeparators(DirList);
|
||||||
repeat
|
while True do begin
|
||||||
If (Result<>'') and FileExists(Result) Then
|
If (Result <> '') and FileExists(Result) Then
|
||||||
exit;
|
exit;
|
||||||
|
If Temp = '' then
|
||||||
|
Break; // No more directories to search - fail
|
||||||
I:=pos(PathSeparator,Temp);
|
I:=pos(PathSeparator,Temp);
|
||||||
If I<>0 then
|
If I<>0 then
|
||||||
begin
|
begin
|
||||||
@ -41,9 +43,9 @@
|
|||||||
Result:=Temp;
|
Result:=Temp;
|
||||||
Temp:='';
|
Temp:='';
|
||||||
end;
|
end;
|
||||||
if Result<>'' then
|
If Result<>'' then
|
||||||
Result:=IncludeTrailingPathDelimiter(Result)+name;
|
Result:=IncludeTrailingPathDelimiter(Result)+name;
|
||||||
until temp='';
|
end;
|
||||||
result:='';
|
result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user