Skip to content

Commit dc76f47

Browse files
[tool] fix the Replace test
1 parent 75f4e22 commit dc76f47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/framework/NetString.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,18 @@ namespace System
184184
String newstring=(*this);
185185

186186
while (pos!=-1){
187-
newstring.str().replace(pos,pos+from.Length(),with.str());
187+
newstring.m_str.replace(pos,pos+from.Length(),with.str());
188188

189189
int lastpos = pos;
190190
pos=newstring.IndexOf(from);
191191

192192
// try to prevent it going infinite
193193
if (pos < lastpos){
194-
pos=-1;
194+
break;
195195
}
196196
}
197197

198-
return from;
198+
return newstring;
199199
}
200200

201201
String Trim() const

0 commit comments

Comments
 (0)