* Fixed bug #9221.

+ Test.

git-svn-id: trunk@7975 -
This commit is contained in:
yury 2007-07-07 17:37:34 +00:00
parent f71c886752
commit 55d6a37865
3 changed files with 18 additions and 3 deletions

1
.gitattributes vendored
View File

@ -8325,6 +8325,7 @@ tests/webtbs/tw9179.pp svneol=native#text/plain
tests/webtbs/tw9187.pp svneol=native#text/plain
tests/webtbs/tw9190.pp svneol=native#text/plain
tests/webtbs/tw9209.pp svneol=native#text/plain
tests/webtbs/tw9221.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain
tests/webtbs/uw0555.pp svneol=native#text/plain

View File

@ -984,9 +984,10 @@ begin
end;
{ Force nil termination in case it gets shorter }
PWord(Pointer(S)+l*sizeof(WideChar))^:=0;
{$ifndef FPC_WINLIKEWIDESTRING}
PWideRec(Pointer(S)-WideFirstOff)^.Len:=l*sizeof(WideChar);
{$endif FPC_WINLIKEWIDESTRING}
{$ifdef MSWINDOWS}
if not winwidestringalloc then
{$endif MSWINDOWS}
PWideRec(Pointer(S)-WideFirstOff)^.Len:=l*sizeof(WideChar);
end
else
begin

13
tests/webtbs/tw9221.pp Normal file
View File

@ -0,0 +1,13 @@
{%target=win32,win64}
var
s: widestring;
begin
winwidestringalloc:=false;
s:='1234';
SetLength(s, 10);
if Length(s) <> 10 then begin
writeln('Test failed!');
Halt(1);
end;
end.