Skip to content

Commit 79af5df

Browse files
[tool] fix the Replace test
1 parent dc76f47 commit 79af5df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/framework/NetString.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,13 @@ namespace System
178178
{
179179
int pos=IndexOf(from);
180180
if (pos==-1){
181-
return from;
181+
return (*this);
182182
}
183183

184184
String newstring=(*this);
185-
186-
while (pos!=-1){
185+
186+
int maxCount=10;
187+
while (pos!=-1 && maxCount--){
187188
newstring.m_str.replace(pos,pos+from.Length(),with.str());
188189

189190
int lastpos = pos;

0 commit comments

Comments
 (0)