diff --git a/form_main.pas b/form_main.pas index 7d07bcf..62bdf37 100644 --- a/form_main.pas +++ b/form_main.pas @@ -356,6 +356,8 @@ function GetLastFindText: string; begin Result:= ''; TCIni:= GetEnvironmentVariable('COMMANDER_INI'); + if TCIni='' then Exit; + with TIniFile.Create(TCIni) do try S:= ReadString('SearchText', '0', ''); @@ -406,18 +408,14 @@ procedure SetLastFindText(const AFindText: string); Free end; - //be careful to not overwrite some existing file which is not the TC ini, - //see issue #112 TCIni:= ExpandEnvironmentVariables(S); if FileExists(TCIni) then - begin with TIniFile.Create(TCIni) do try WriteString('SearchText', '0', AFindText); finally Free end; - end; end; { TfmMain }