]> git.mxchange.org Git - simgear.git/commitdiff
Quick fix for bug reported by Julian Foad, where the simplify flag was
authordavid <david>
Thu, 18 Jul 2002 20:04:50 +0000 (20:04 +0000)
committerdavid <david>
Thu, 18 Jul 2002 20:04:50 +0000 (20:04 +0000)
not honoured after the first call.  This isn't all that efficient, and
the return type probably should change to string eventually, but this
fix avoids changing the headers for now.

simgear/misc/props.cxx

index 39db0462c03ec1d7d5f7017bd54d17c648ee83fc..ca4bb5281462d1ef99d10a1e72e045904516b494 100644 (file)
@@ -938,15 +938,13 @@ SGPropertyNode::removeChild (const char * name, int index, bool keep)
 const char *
 SGPropertyNode::getDisplayName (bool simplify) const
 {
-  if (_display_name == 0) {
-    string display = _name;
-    if (_index != 0 || !simplify) {
-      char buffer[64];
-      sprintf(buffer, "[%d]", _index);
-      display += buffer;
-    }
-    _display_name = copy_string(display.c_str());
+  string display = _name;
+  if (_index != 0 || !simplify) {
+    char buffer[64];
+    sprintf(buffer, "[%d]", _index);
+    display += buffer;
   }
+  _display_name = copy_string(display.c_str());
   return _display_name;
 }