fix error replacing strings in a string, and optimise literal strings a bit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34081 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-10-28 14:25:17 +00:00
parent 8870a4331f
commit a4c7e88a11
3 changed files with 42 additions and 3 deletions

View file

@ -5524,8 +5524,15 @@ static NSFileManager *fm = nil;
searchRange.location = range.location + byLen;
searchRange.length = newEnd - searchRange.location;
}
range = (*func)(self, replace, opts, searchRange);
if (searchRange.length > 0)
{
/* We replaced something and now need to scan again.
* As we modified the receiver, we must refresh the
* method implementation for searching.
*/
func = GSPrivateRangeOfString(self, replace);
range = (*func)(self, replace, opts, searchRange);
}
}
while (range.length > 0);
}