mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 13:49:17 +02:00
* File searching now as in compiler, using lower and uppercase filenames if needed
git-svn-id: trunk@11049 -
This commit is contained in:
parent
73a3507bac
commit
5b812fd878
@ -159,12 +159,14 @@ type
|
||||
TFileResolver = class
|
||||
private
|
||||
FIncludePaths: TStringList;
|
||||
FStrictFileCase : Boolean;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure AddIncludePath(const APath: string);
|
||||
function FindSourceFile(const AName: string): TLineReader;
|
||||
function FindIncludeFile(const AName: string): TLineReader;
|
||||
Property StrictFileCase : Boolean Read FStrictFileCase Write FStrictFileCase;
|
||||
end;
|
||||
|
||||
EScannerError = class(Exception);
|
||||
@ -413,7 +415,20 @@ begin
|
||||
begin
|
||||
Try
|
||||
FN:=FIncludePaths[i]+AName;
|
||||
If FileExists(FN) then
|
||||
If not FileExists(FN) then
|
||||
If StrictFileCase then
|
||||
FN:=''
|
||||
else
|
||||
begin
|
||||
fn:=LowerCase(FN);
|
||||
If not FileExists(Fn) then
|
||||
begin
|
||||
FN:=uppercase(Fn);
|
||||
If not FileExists(FN) then
|
||||
FN:='';
|
||||
end;
|
||||
end;
|
||||
If (FN<>'') then
|
||||
Result := TFileLineReader.Create(FN);
|
||||
except
|
||||
Result:=Nil;
|
||||
|
Loading…
Reference in New Issue
Block a user