Fixed List index out of bounds bug while saving a single flame.

This commit is contained in:
utak3r 2006-04-18 09:17:28 +00:00
parent a885e4252b
commit d116ed5874

View File

@ -1467,6 +1467,8 @@ begin
FileList[0] := '<Flames name="' + Tag + '">'; FileList[0] := '<Flames name="' + Tag + '">';
end; end;
if FileList.Count > 2 then
begin
if pos('<flame ', FileList.text) <> 0 then if pos('<flame ', FileList.text) <> 0 then
repeat repeat
FileList.Delete(FileList.Count - 1); FileList.Delete(FileList.Count - 1);
@ -1476,6 +1478,10 @@ begin
FileList.Delete(FileList.Count - 1); FileList.Delete(FileList.Count - 1);
until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or
(Pos('</Flames>', FileList[FileList.count - 1]) <> 0); (Pos('</Flames>', FileList[FileList.count - 1]) <> 0);
end else
begin
FileList.Delete(FileList.Count - 1);
end;
FileList.Add(Trim(FlameToXML(cp1, false))); FileList.Add(Trim(FlameToXML(cp1, false)));
FileList.Add('</Flames>'); FileList.Add('</Flames>');