mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-28 17:19:18 +02:00
* fix for 9770
git-svn-id: trunk@8689 -
This commit is contained in:
parent
f5250c6433
commit
7429c4871b
@ -350,17 +350,22 @@ end;
|
|||||||
Function StuffString(const AText: string; AStart, ALength: Cardinal; const ASubText: string): string;
|
Function StuffString(const AText: string; AStart, ALength: Cardinal; const ASubText: string): string;
|
||||||
|
|
||||||
var i,j : SizeUInt;
|
var i,j : SizeUInt;
|
||||||
|
k : SizeInt;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
j:=length(ASubText);
|
j:=length(ASubText);
|
||||||
i:=length(AText);
|
i:=length(AText);
|
||||||
|
if AStart>i then
|
||||||
|
aStart:=i+1;
|
||||||
|
k:=i-AStart+1;
|
||||||
|
if ALength> k then
|
||||||
|
ALength:=k;
|
||||||
SetLength(Result,i+j-ALength);
|
SetLength(Result,i+j-ALength);
|
||||||
move (AText[1],result[1],AStart-1);
|
move (AText[1],result[1],AStart-1);
|
||||||
move (ASubText[1],result[AStart],j);
|
move (ASubText[1],result[AStart],j);
|
||||||
move (AText[AStart+ALength], Result[AStart+j],i+1-AStart-ALength);
|
move (AText[AStart+ALength], Result[AStart+j],i+1-AStart-ALength);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function RandomFrom(const AValues: array of string): string; overload;
|
Function RandomFrom(const AValues: array of string): string; overload;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user