+/*public*/
+const std::string
+character::getTarget() const
+{
+
+  // TODO: maybe cache computed target?
+
+       std::string target_dot;
+
+       std::string levelString = "_level0"; // TODO: support real levels!
+
+       const std::string& targetPath = getTargetPath();
+       if ( targetPath == "/" ) target_dot = levelString;
+       else
+       {
+               target_dot = levelString + targetPath;
+               for (std::string::size_type i=0; i<target_dot.length(); ++i)
+               {
+                       if ( target_dot[i] == '/' ) target_dot[i] = '.';
+               }
+       }
+
+       return target_dot;
+}
+
+/*public*/
+const char*   <----------------------------------[1]
+character::get_text_value() const
+{
+       return getTarget().c_str();
+}
+

[1] return a pointer to a local string!!! We won't get any text value
from it.   This caused odd problem with my event related testcase(just
changed the event order without invoking any other obvious problem),
and cost me an hour to track this. Our testsuite seems too weak to
prevent any thing.

Please fix this!


_______________________________________________
Gnash-commit mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-commit

Reply via email to