瀏覽代碼

* Allow to disable 8.3 filename search

Michaël Van Canneyt 1 年之前
父節點
當前提交
c9b88a1cd0
共有 8 個文件被更改,包括 741 次插入713 次删除
  1. 24 17
      compiler/cfileutl.pas
  2. 1 0
      compiler/fppu.pas
  3. 3 0
      compiler/globals.pas
  4. 6 0
      compiler/globtype.pas
  5. 4 0
      compiler/msg/errore.msg
  6. 3 2
      compiler/msgidx.inc
  7. 695 694
      compiler/msgtxt.inc
  8. 5 0
      compiler/options.pas

+ 24 - 17
compiler/cfileutl.pas

@@ -144,6 +144,7 @@ interface
 { * Since native Amiga commands can't handle Unix-style relative paths used by the compiler,
     and some GNU tools, Unix2AmigaPath is needed to handle such situations (KB) * }
 
+
 {$IFDEF HASAMIGA}
 { * PATHCONV is implemented in the Amiga/MorphOS system unit * }
 {$NOTE TODO Amiga: implement PathConv() in System unit, which works with AnsiString}
@@ -603,30 +604,36 @@ end;
                3. UPPERCASE
             }
             FoundFile:=path+fn;
-            If FileExists(FoundFile,allowcache) then
+            If (ftNone in AllowedFilenameTransFormations) and FileExists(FoundFile,allowcache) then
              begin
                result:=true;
                exit;
              end;
-            fn2:=Lower(fn);
-            if fn2<>fn then
+            if (ftLowerCase in AllowedFilenameTransFormations) then
               begin
-                FoundFile:=path+fn2;
-                If FileExists(FoundFile,allowcache) then
-                 begin
-                   result:=true;
-                   exit;
-                 end;
+                fn2:=Lower(fn);
+                if (fn2<>fn) then
+                  begin
+                    FoundFile:=path+fn2;
+                    If FileExists(FoundFile,allowcache) then
+                     begin
+                       result:=true;
+                       exit;
+                     end;
+                  end;
               end;
-            fn2:=Upper(fn);
-            if fn2<>fn then
+            if (ftUpperCase in AllowedFilenameTransFormations)  then
               begin
-                FoundFile:=path+fn2;
-                If FileExists(FoundFile,allowcache) then
-                 begin
-                   result:=true;
-                   exit;
-                 end;
+                fn2:=Upper(fn);
+                if (fn2<>fn) then
+                  begin
+                  FoundFile:=path+fn2;
+                  If FileExists(FoundFile,allowcache) then
+                    begin
+                      result:=true;
+                      exit;
+                    end;
+                  end;
               end;
           end
         else

+ 1 - 0
compiler/fppu.pas

@@ -415,6 +415,7 @@ var
         if search_unit(onlysource,false) then
           found:=true;
         if (not found) and
+           (ft83 in AllowedFilenameTransFormations) and
            (length(modulename^)>8) and
            search_unit(onlysource,true) then
           found:=true;

+ 3 - 0
compiler/globals.pas

@@ -734,6 +734,9 @@ Const
   const
     ExecuteProcess = 'Do not use' deprecated 'Use cfileutil.RequotedExecuteProcess instead, ExecuteProcess cannot deal with single quotes as used by Unix command lines';
 
+  var
+    AllowedFilenameTransFormations : tfilenametransformations = AllTransformations;
+
 
 implementation
 

+ 6 - 0
compiler/globtype.pas

@@ -935,6 +935,12 @@ interface
   const
     ExecuteProcess = 'Do not use' deprecated 'Use cfileutil.RequotedExecuteProcess instead, ExecuteProcess cannot deal with single quotes as used by Unix command lines';
 
+  Type
+    tfilenametransformation = (ftNone,ftLowerCase,ftUpperCase,ft83);
+    tfilenametransformations = set of tfilenametransformation;
+
+   Const AllTransformations = [Low(tfilenametransformation)..high(tfilenametransformation)];
+
 implementation
 
 end.

+ 4 - 0
compiler/msg/errore.msg

@@ -143,6 +143,9 @@ general_t_unitscope=01027_T_Using unit scope: $1
 % When the \var{-vt} switch is used, this line tells you what unit scopes (namespaces)
 % the compiler is using when looking up units. You can add a unit scope with the
 % \var{-FN} option.
+general_i_reduced_filesearch=01028_I_Reduced file search: Not searching for uppercased or 8.3 unit filenames.
+% When the \var{-Ft} switch is used, this line informs you that the compiler
+% will not look for uppercased filenames or 8.3 conforming filenames.
 % \end{description}
 #
 # Scanner
@@ -4108,6 +4111,7 @@ A*2CV<x>_Set section threadvar model to <x>
 **2Fo<x>_Add <x> to object path
 **2Fr<x>_Load error message file <x>
 **2FR<x>_Set resource (.res) linker to <x>
+**2Ft_Do not search uppercased or 8.3 unit filenames on case sensitive filesystems.
 **2Fu<x>_Add <x> to unit path
 **2FU<x>_Set unit output path to <x>, overrides -FE
 **2Fw<x>_Load previously stored whole-program optimization feedback from <x>

+ 3 - 2
compiler/msgidx.inc

@@ -27,6 +27,7 @@ const
   general_f_oserror=01025;
   general_e_exception_raised=01026;
   general_t_unitscope=01027;
+  general_i_reduced_filesearch=01028;
   scan_f_end_of_file=02000;
   scan_f_string_exceeds_line=02001;
   scan_f_illegal_char=02002;
@@ -1169,9 +1170,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 92057;
+  MsgTxtSize = 92222;
 
   MsgIdxMax : array[1..20] of longint=(
-    28,109,371,134,102,63,148,38,223,71,
+    29,109,371,134,102,63,148,38,223,71,
     68,20,30,1,1,1,1,1,1,1
   );

文件差異過大導致無法顯示
+ 695 - 694
compiler/msgtxt.inc


+ 5 - 0
compiler/options.pas

@@ -3101,6 +3101,11 @@ begin
       Msgfilename:=More;
     'R' :
       ResCompiler:=More;
+    't' :
+      begin
+        AllowedFilenameTransFormations:=[ftNone,ftLowerCase];
+        Message(general_i_reduced_filesearch);
+      end;
     'u' :
       begin
         if ispara then

部分文件因文件數量過多而無法顯示