source file of the GNU LilyPond music typesetter
- (c) 2006--2008 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2006--2009 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "std-string.hh"
replace_all (string *str, string const &find, string const &replace)
{
ssize len = find.length ();
- for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + len))
+ ssize replen = replace.length ();
+ for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + replen))
*str = str->replace (i, len, replace);
return *str;
}