Browse Source

* File searching now as in compiler, using lower and uppercase filenames if needed

git-svn-id: trunk@11049 -
michael 17 years ago
parent
commit
5b812fd878
1 changed files with 16 additions and 1 deletions
  1. 16 1
      packages/fcl-passrc/src/pscanner.pp

+ 16 - 1
packages/fcl-passrc/src/pscanner.pp

@@ -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;