ProjectTemplates: Prevent wrongly replacing "project" in .lpi file. Issue #39467.

This commit is contained in:
Juha 2021-11-17 03:14:42 +02:00
parent dda3cc7c81
commit dda96a3864
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ uses
// LCL // LCL
LResources, Forms, Controls, Graphics, Dialogs, LResources, Forms, Controls, Graphics, Dialogs,
// LazUtils // LazUtils
LazFileUtils, LazFileUtils, LazLoggerBase,
// IdeIntf // IdeIntf
ProjectIntf, NewItemIntf, MenuIntf, BaseIDEIntf, LazIDEIntf, ProjectIntf, NewItemIntf, MenuIntf, BaseIDEIntf, LazIDEIntf,
// ProjectTemplates // ProjectTemplates
@ -113,7 +113,8 @@ var
sl: TStringList; sl: TStringList;
i: Integer; i: Integer;
begin begin
if not FileExistsUTF8(FN) then //DebugLn(['FileReplaceText: From=', AFrom, ', To=', ATo]);
if (not FileExistsUTF8(FN)) or (AFrom='') then
exit; exit;
sl:=TStringList.Create; sl:=TStringList.Create;
try try

View File

@ -254,7 +254,7 @@ begin
inherited Create(ACollection); inherited Create(ACollection);
FVariables:=TStringList.Create; FVariables:=TStringList.Create;
FFiles:=TStringList.Create; FFiles:=TStringList.Create;
FProjectFile:='project' // Do not localize FProjectFile:='';
end; end;