X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fstd-string.cc;h=c309483cd8306ef3e679b16bf8770f4c82ce8ace;hb=94fc7a7c2af826453914811c177daea8e3f5afb1;hp=ec5ddffbd4bd05f013b666004938e7350a50ec15;hpb=e344ae579fa1d81fc6c6f3049494697872fd39f9;p=lilypond.git diff --git a/flower/std-string.cc b/flower/std-string.cc index ec5ddffbd4..c309483cd8 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -1,9 +1,20 @@ /* - std-string.cc -- implement external interface for Std_String + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2006--2010 Jan Nieuwenhuizen - (c) 2006--2008 Jan Nieuwenhuizen + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "std-string.hh" @@ -80,7 +91,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; }