mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 02:29:36 +02:00
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:
parent
0550c547f4
commit
f8b5920f31
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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;
|
||||
|
9
tests/test/tunistrcopy.pp
Normal file
9
tests/test/tunistrcopy.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user