From 960f20fe1e83e4e43b73131ab777e754346734e8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 27 May 2011 11:07:04 +0000 Subject: [PATCH] Fixed the searchAndReplace function so that it correctly skips over the newly inserted replacement strings. --- examples/osg2cpp/osg2cpp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/osg2cpp/osg2cpp.cpp b/examples/osg2cpp/osg2cpp.cpp index 33357af2c..a76f7c975 100644 --- a/examples/osg2cpp/osg2cpp.cpp +++ b/examples/osg2cpp/osg2cpp.cpp @@ -14,6 +14,7 @@ void searchAndReplace(std::string& str, const std::string& spat, const std::stri while ((pos = str.find(spat, pos)) != std::string::npos) { str.replace(pos, spat.length(), rpat); + pos += rpat.length(); } }