Fix "List index out of bounds" in HandlePortableSettings() when Explode adds an empty item onto the end, since r3231. Fixes issue #1838.

This commit is contained in:
Ansgar Becker
2010-04-08 23:30:00 +00:00
parent 2c319fb80a
commit 5131f2a4de

View File

@@ -3627,8 +3627,10 @@ begin
Content := ReadTextfile(FileName);
Lines := Explode(CRLF, Content);
for i:=0 to Lines.Count-1 do begin
// Each line has 3 segments: reg path | data type | value
// Each line has 3 segments: reg path | data type | value. Continue if explode finds less or more than 3.
Segments := Explode(Delimiter, Lines[i]);
if Segments.Count <> 3 then
continue;
KeyPath := RegPath + ExtractFilePath(Segments[0]);
Name := ExtractFileName(Segments[0]);
DataType := TRegDataType(StrToInt(Segments[1]));