|
@@ -463,13 +463,15 @@ end;
|
|
|
|
|
|
Procedure fpc_ansistr_append_ansistring(Var S : AnsiString;const Str : AnsiString); [Public,Alias : 'FPC_ANSISTR_APPEND_ANSISTRING']; compilerproc;
|
|
|
var
|
|
|
- ofs : SizeInt;
|
|
|
+ ofs, strlength : SizeInt;
|
|
|
begin
|
|
|
if Str='' then
|
|
|
exit;
|
|
|
+ { needed in case s and str are the same string }
|
|
|
+ strlength := length(str);
|
|
|
ofs:=Length(S);
|
|
|
SetLength(S,ofs+length(Str));
|
|
|
- move(Str[1],S[ofs+1],length(Str)+1);
|
|
|
+ move(Str[1],S[ofs+1],strlength+1);
|
|
|
end;
|
|
|
|
|
|
Function Fpc_Ansistr_Copy (Const S : AnsiString; Index,Size : SizeInt) : AnsiString;compilerproc;
|