* Allow to disable 8.3 filename search

This commit is contained in:
Michaël Van Canneyt 2023-11-12 09:55:30 +01:00
parent d8700e5190
commit c9b88a1cd0
8 changed files with 998 additions and 967 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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