]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/std-string.cc
Translation build: stop building general.texi in the wrong place.
[lilypond.git] / flower / std-string.cc
index ec5ddffbd4bd05f013b666004938e7350a50ec15..53fd548bfa340f422fc6cce872f6ed590ceb967f 100644 (file)
@@ -3,7 +3,7 @@
 
   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"
@@ -80,7 +80,8 @@ string &
 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;
 }