mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 18:24:19 +02:00
* fixed getting of value when there was no separator. But it still
doesn't work for fpcmake
This commit is contained in:
parent
e15480418d
commit
a80d41f95f
@ -448,7 +448,7 @@ end;
|
|||||||
|
|
||||||
procedure TIniFile.FillSectionList(AStrings: TStrings);
|
procedure TIniFile.FillSectionList(AStrings: TStrings);
|
||||||
var
|
var
|
||||||
i: integer;
|
i,j: integer;
|
||||||
sLine, sIdent, sValue: string;
|
sLine, sIdent, sValue: string;
|
||||||
oSection: TIniFileSection;
|
oSection: TIniFileSection;
|
||||||
|
|
||||||
@ -508,8 +508,17 @@ begin
|
|||||||
sValue := '';
|
sValue := '';
|
||||||
end else begin
|
end else begin
|
||||||
// regular key
|
// regular key
|
||||||
sIdent := Trim(Copy(sLine, 1, Pos(Separator, sLine) - 1));
|
j:=Pos(Separator, sLine);
|
||||||
sValue := Trim(Copy(sLine, Pos(Separator, sLine) + 1, Length(sLine) - Length(sIdent) - 1));
|
if j=0 then
|
||||||
|
begin
|
||||||
|
sIdent:='';
|
||||||
|
sValue:=sLine
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
sIdent:=Trim(Copy(sLine, 1, j- 1));
|
||||||
|
sValue:=Trim(Copy(sLine, j + 1, Length(sLine) - j - 1));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue));
|
oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue));
|
||||||
end;
|
end;
|
||||||
@ -591,7 +600,12 @@ begin
|
|||||||
if oSection <> nil then with oSection.KeyList do
|
if oSection <> nil then with oSection.KeyList do
|
||||||
for i := 0 to Count-1 do
|
for i := 0 to Count-1 do
|
||||||
if not IsComment(Items[i].Ident) then
|
if not IsComment(Items[i].Ident) then
|
||||||
Strings.Add(Items[i].Ident + Separator + Items[i].Value);
|
begin
|
||||||
|
if Items[i].Ident<>'' then
|
||||||
|
Strings.Add(Items[i].Ident + Separator +Items[i].Value)
|
||||||
|
else
|
||||||
|
Strings.Add(Items[i].Value);
|
||||||
|
end;
|
||||||
finally
|
finally
|
||||||
Strings.EndUpdate;
|
Strings.EndUpdate;
|
||||||
end;
|
end;
|
||||||
@ -756,7 +770,11 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2000-05-10 16:43:43 michael
|
Revision 1.12 2000-05-11 14:50:01 peter
|
||||||
|
* fixed getting of value when there was no separator. But it still
|
||||||
|
doesn't work for fpcmake
|
||||||
|
|
||||||
|
Revision 1.11 2000/05/10 16:43:43 michael
|
||||||
+ New implementation by Erik WachtMeester
|
+ New implementation by Erik WachtMeester
|
||||||
|
|
||||||
Revision ?.? 2000/04/29 13:51:00 erik
|
Revision ?.? 2000/04/29 13:51:00 erik
|
||||||
|
Loading…
Reference in New Issue
Block a user