Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-11

Inifile bug

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jean-Pierre PLANAS

Hello

Bug in Inifile (version 1.02)

In inifile, line 523, in TIniFile.FillSectionList method, a call to oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue)) is made even if sIdent='' and sValue=''.
I think that when the test "if sLine > '' then" is made, a begin/end section must stop the add of a new key.

The problem then is we have empty keys and so when the file is saved, we have line witch contains only the char '=', because the key='' and the value='', but the key exist...

How to correct the bug :
Add a "begin" at line 495
Add a 'end" at line 525

Jean-Pierre

Unknown author
to Jean-Pierre PLANAS
Jean-Pierre PLANAS wrote 17 lines
Hello Bug in Inifile (version 1.02) In inifile, line 523, in TIniFile.FillSectionList method, a call to oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue)) is made even if sIdent='' and sValue=''. I think that when the test "if sLine > '' then" is made, a begin/end section must stop the add of a new key. The problem then is we have empty keys and so when the file is saved, we have line witch contains only the char '=', because the key='' and the value='', but the key exist... How to correct the bug : Add a "begin" at line 495 Add a 'end" at line 525

I have added the fix; the change is in both fix branch and main branch; please download tomorrow's fcl10.zip and let me know if it's correct (or send me code to test it myself...)

Michael.

Jean-Pierre PLANAS
to Unknown author
you wrote 23 lines
On Sun, 26 Nov 2000, Jean-Pierre PLANAS wrote: > Hello > > Bug in Inifile (version 1.02) > > In inifile, line 523, in TIniFile.FillSectionList method, a call to > oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue)) > is made even if sIdent='' and sValue=''. > I think that when the test "if sLine > '' then" is made, a begin/end > section must stop the add of a new key. > > The problem then is we have empty keys and so when the file is saved, we > have line witch contains only the char '=', because the key='' and the > value='', but the key exist... > > How to correct the bug : > Add a "begin" at line 495 > Add a 'end" at line 525 I have added the fix; the change is in both fix branch and main branch; please download tomorrow's fcl10.zip and let me know if it's correct (or send me code to test it myself...)

ok, i confirm it's correct.
Thanks.

Jean-Pierre