mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 20:08:00 +01:00
+ Fix for relative pathnames in include files, and code cleanup
This commit is contained in:
parent
abd581ac2b
commit
0576d558ce
@ -374,7 +374,7 @@ end;
|
|||||||
|
|
||||||
procedure TFileResolver.AddIncludePath(const APath: String);
|
procedure TFileResolver.AddIncludePath(const APath: String);
|
||||||
begin
|
begin
|
||||||
FIncludePaths.Add(IncludeTrailingPathDelimiter(APath));
|
FIncludePaths.Add(IncludeTrailingPathDelimiter(ExpandFileName(APath)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFileResolver.FindSourceFile(const AName: String): TLineReader;
|
function TFileResolver.FindSourceFile(const AName: String): TLineReader;
|
||||||
@ -392,16 +392,25 @@ end;
|
|||||||
function TFileResolver.FindIncludeFile(const AName: String): TLineReader;
|
function TFileResolver.FindIncludeFile(const AName: String): TLineReader;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
FN : String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
try
|
If FileExists(AName) then
|
||||||
Result := TFileLineReader.Create(AName);
|
Result := TFileLineReader.Create(AName)
|
||||||
except
|
else
|
||||||
for i := 0 to FIncludePaths.Count - 1 do
|
begin
|
||||||
try
|
I:=0;
|
||||||
Result := TFileLineReader.Create(FIncludePaths[i] + AName);
|
While (Result=Nil) and I<FIncludePaths.Count do
|
||||||
break;
|
begin
|
||||||
|
Try
|
||||||
|
FN:=FIncludePaths[i]+AName;
|
||||||
|
If FileExists(FN) then
|
||||||
|
Result := TFileLineReader.Create(FN);
|
||||||
except
|
except
|
||||||
|
Result:=Nil;
|
||||||
|
end;
|
||||||
|
Inc(I);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1026,7 +1035,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.7 2004-07-23 23:41:10 michael
|
Revision 1.8 2004-08-25 09:32:39 michael
|
||||||
|
+ Fix for relative pathnames in include files, and code cleanup
|
||||||
|
|
||||||
|
Revision 1.7 2004/07/23 23:41:10 michael
|
||||||
+ Fixed scanning of strings with quotes in them
|
+ Fixed scanning of strings with quotes in them
|
||||||
|
|
||||||
Revision 1.6 2004/05/01 20:08:51 marco
|
Revision 1.6 2004/05/01 20:08:51 marco
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user