merge r17438 from cpstrnew branch by michael:

* Applied patch from Inoussa to fix copy of unicode string

git-svn-id: trunk@19112 -
This commit is contained in:
paul 2011-09-17 13:27:26 +00:00
parent 0550c547f4
commit f8b5920f31
3 changed files with 11 additions and 1 deletions

1
.gitattributes vendored
View File

@ -10528,6 +10528,7 @@ tests/test/tunistr4.pp svneol=native#text/plain
tests/test/tunistr5.pp svneol=native#text/plain
tests/test/tunistr6.pp svneol=native#text/plain
tests/test/tunistr7.pp svneol=native#text/plain
tests/test/tunistrcopy.pp svneol=native#text/plain
tests/test/tunit1.pp svneol=native#text/plain
tests/test/tunit2.pp svneol=native#text/plain
tests/test/tunit3.pp svneol=native#text/plain

View File

@ -1585,7 +1585,7 @@ begin
if ResultAddress<>Nil then
begin
Move (PUnicodeChar(S)[Index],ResultAddress^,Size*sizeof(UnicodeChar));
PUnicodeRec(ResultAddress-UnicodeFirstOff)^.Len:=Size*sizeof(UnicodeChar);
PUnicodeRec(ResultAddress-UnicodeFirstOff)^.Len:=Size;
PUnicodeChar(ResultAddress+Size*sizeof(UnicodeChar))^:=#0;
end;
end;

View File

@ -0,0 +1,9 @@
var
a, b : UnicodeString;
begin
a := '12345';
b := Copy(a,1,Length(a));
if (a <> b) then
Halt(1);
WriteLn('ok');
end.