mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 18:09:32 +02:00
Codetools: In function IsCompilerExecutable fix dcc extension check and fix return value.
git-svn-id: trunk@62634 -
This commit is contained in:
parent
6483f57d33
commit
ec192ce438
@ -3892,10 +3892,8 @@ end;
|
||||
function IsCTExecutable(AFilename: string; out ErrorMsg: string): boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
AFilename:=ResolveDots(aFilename);
|
||||
//debugln(['IsFPCExecutable ',AFilename]);
|
||||
//debugln(['IsFPCompiler START ',aFilename]);
|
||||
if aFilename='' then begin
|
||||
AFilename:=ResolveDots(AFilename);
|
||||
if AFilename='' then begin
|
||||
ErrorMsg:='missing file name';
|
||||
exit;
|
||||
end;
|
||||
@ -3946,13 +3944,13 @@ var
|
||||
Lines: TStringList;
|
||||
i: Integer;
|
||||
begin
|
||||
Result:=IsCTExecutable(AFilename,ErrorMsg);
|
||||
if not Result then exit;
|
||||
Result:=False;
|
||||
if not IsCTExecutable(AFilename,ErrorMsg) then exit;
|
||||
Kind:=pcFPC;
|
||||
|
||||
// allow scripts like fpc.sh and fpc.bat
|
||||
ShortFilename:=ExtractFileNameOnly(AFilename);
|
||||
//debugln(['IsFPCompiler Short=',ShortFilename]);
|
||||
//debugln(['IsCompilerExecutable Short=',ShortFilename]);
|
||||
|
||||
// check ppc*.exe
|
||||
if CompareText(LeftStr(ShortFilename,3),'ppc')=0 then
|
||||
@ -3966,7 +3964,7 @@ begin
|
||||
|
||||
// dcc*.exe
|
||||
if (CompareFilenames(LeftStr(ShortFilename,3),'dcc')=0)
|
||||
and ((ExeExt='') or (CompareFileExt(ShortFilename,ExeExt)=0))
|
||||
and ((ExeExt='') or (CompareFileExt(AFilename,ExeExt)=0))
|
||||
then begin
|
||||
Kind:=pcDelphi;
|
||||
exit(true);
|
||||
@ -4010,7 +4008,6 @@ begin
|
||||
exit(true);
|
||||
|
||||
ErrorMsg:='fpc executable should start with fpc or ppc';
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function IsFPCExecutable(AFilename: string; out ErrorMsg: string; Run: boolean
|
||||
@ -4029,7 +4026,7 @@ begin
|
||||
|
||||
// allow scripts like fpc*.sh and fpc*.bat
|
||||
ShortFilename:=LowerCase(ExtractFileNameOnly(AFilename));
|
||||
//debugln(['IsFPCompiler Short=',ShortFilename]);
|
||||
//debugln(['IsFPCExecutable Short=',ShortFilename]);
|
||||
if (LeftStr(ShortFilename,3)='fpc') then
|
||||
exit(true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user