[Orxonox-commit 5613] r10273 - code/trunk/src/libraries/core

landauf at orxonox.net landauf at orxonox.net
Sun Feb 15 21:46:31 CET 2015


Author: landauf
Date: 2015-02-15 21:46:31 +0100 (Sun, 15 Feb 2015)
New Revision: 10273

Modified:
   code/trunk/src/libraries/core/Loader.cc
Log:
bugfix & simplification & comment by bknecht

Modified: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	2015-02-15 20:37:54 UTC (rev 10272)
+++ code/trunk/src/libraries/core/Loader.cc	2015-02-15 20:46:31 UTC (rev 10273)
@@ -337,9 +337,10 @@
         }
 
         // erase all tags from the map that are between two quotes
+        // that means occurrences like "..<?lua.." and "..?>.." would be deleted
+        // however occurrences of lua tags within quotas are retained: ".. <?lua ... ?> .. "
         {
             std::map<size_t, bool>::iterator it = luaTags.begin();
-            std::map<size_t, bool>::iterator it2 = it;
             bool bBetweenQuotes = false;
             size_t pos = 0;
             while ((pos = getNextQuote(text, pos)) != std::string::npos)
@@ -348,9 +349,10 @@
                 {
                     if (bBetweenQuotes)
                     {
+                        std::map<size_t, bool>::iterator it2 = it;
                         it2++;
                         if (it->second && !(it2->second) && it2->first < pos)
-                            it = ++it2;
+                            std::advance(it, 2);
                         else
                             luaTags.erase(it++);
                     }




More information about the Orxonox-commit mailing list