Broken winlike widestring support
Original Reporter info from Mantis: Bonart
-
Reporter name: Kirill A. Maurin
Original Reporter info from Mantis: Bonart
- Reporter name: Kirill A. Maurin
Description:
If winwidestringalloc is false - SetLength does not carry out change of length of a line.
Additional information:
Sample:
var
s: string;
begin
winwidestringalloc := false;
s := 'Test';
s := 'Wide test';
WriteLn(s, ' ', length(s));
end.
Result:
Wide 4
Error in lines 987-989 in file wstrings.inc :
{$ifndef FPC_WINLIKEWIDESTRING}
PWideRec(Pointer(S)-WideFirstOff)^.Len:=l*sizeof(WideChar);
{$endif FPC_WINLIKEWIDESTRING}
Correct:
{$ifdef MSWINDOWS}
if not winwidestringalloc then
{$endif MSWINDOWS}
Patch included
Mantis conversion info:
- Mantis ID: 9221
- Version: 2.2.0
- Fixed in version: 2.2.0
- Fixed in revision: 7986 (#bf4d4997)