From 7a037bb1df7cae63b6a1260a20a22bb2c04b9162 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 21 Mar 2001 03:51:54 +0000 Subject: [PATCH] *** empty log message *** --- dtool/src/dconfig/notify.cxx | 17 +++++++++++------ panda/src/sgmanip/nodePath.cxx | 5 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dtool/src/dconfig/notify.cxx b/dtool/src/dconfig/notify.cxx index 350ff41074..e704802c63 100644 --- a/dtool/src/dconfig/notify.cxx +++ b/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 diff --git a/panda/src/sgmanip/nodePath.cxx b/panda/src/sgmanip/nodePath.cxx index 5a70b8da87..e33a3b9b26 100644 --- a/panda/src/sgmanip/nodePath.cxx +++ b/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; }