Sign in Join

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

Mailing lists / fpc-devel / 2008-04

TStrings.Assign bug + patch

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Paul Ishenin

Hello, FPC developers' list.

I found a bug in TStrings.Assign. TStrings has FLBS (line break style) field which assigned from default value in CheckSpecialChars. FSpecialCharsInited controls whether CheckSpecialChars had been called before.

But in TString.Assign FSpecialCharsInited setted to value from source and all other fields setted from source except FLBS. This cause errors when you assign initialized list to uninitialized. FLBS will stay undefined in this case.

Attached patch fixes this bug.

Please apply to trunk and fixes_2_2 since lcl and lazarus ide depends on it.

Best regards, Paul Ishenin.

Reply by email

Michael Van Canneyt
to Paul Ishenin
Paul Ishenin wrote 13 lines
Hello, FPC developers' list. I found a bug in TStrings.Assign. TStrings has FLBS (line break style) field which assigned from default value in CheckSpecialChars. FSpecialCharsInited controls whether CheckSpecialChars had been called before. But in TString.Assign FSpecialCharsInited setted to value from source and all other fields setted from source except FLBS. This cause errors when you assign initialized list to uninitialized. FLBS will stay undefined in this case. Attached patch fixes this bug. Please apply to trunk and fixes_2_2 since lcl and lazarus ide depends on it.

Applied and merged.

Thank you for the patch.

Michael.

Reply by email