Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
7a037bb1df
2 changed files with 14 additions and 8 deletions
  1. 11 6
      dtool/src/dconfig/notify.cxx
  2. 3 2
      panda/src/sgmanip/nodePath.cxx

+ 11 - 6
dtool/src/dconfig/notify.cxx

@@ -378,18 +378,23 @@ ptr() {
 bool Notify::
 assert_failure(const char *expression, int line,
 	       const char *source_file) {
-  _assert_failed = true;
-
-  ostringstream message;
-  message 
+  ostringstream message_str;
+  message_str 
     << expression << " at line " << line << " of " << source_file;
-  _assert_error_message = message.str();
+  string message = message_str.str();
+
+  if (!_assert_failed) {
+    // We only save the first assertion failure message, as this is
+    // usually the most meaningful when several occur in a row.
+    _assert_failed = true;
+    _assert_error_message = message;
+  }
 
   if (has_assert_handler()) {
     return (*_assert_handler)(expression, line, source_file);
   }
 
-  nout << "Assertion failed: " << _assert_error_message << "\n";
+  nout << "Assertion failed: " << message << "\n";
 
   if (get_assert_abort()) {
 #ifdef WIN32

+ 3 - 2
panda/src/sgmanip/nodePath.cxx

@@ -2504,15 +2504,16 @@ r_as_string(const ArcComponent *comp, string &result, int skip_nodes) const {
 	// This is not the first node, so format a slash between the
 	// previous node and this node.
 
-	if (comp->_arc->get_parent() == comp->_next->_arc->get_child()) {
+	if (comp->_arc->get_child() == (Node *)NULL ||
+	    comp->_arc->get_parent() == comp->_next->_arc->get_child()) {
 	  result += "/";
 	} else {
 	  // Unless the path is broken here.  In this case, insert a
 	  // visual indication of the break.
 	  result += "/.../" + format_node_name(comp->_arc->get_parent()) + "/";
 	}
+	result += format_node_name(comp->_arc->get_child());
       }
-      result += format_node_name(comp->_arc->get_child());
     }
     return nodes_before + 1;
   }