diff options
Diffstat (limited to 'devel/kyua-cli/files/patch-utils-config-tree.ipp')
-rw-r--r-- | devel/kyua-cli/files/patch-utils-config-tree.ipp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/devel/kyua-cli/files/patch-utils-config-tree.ipp b/devel/kyua-cli/files/patch-utils-config-tree.ipp deleted file mode 100644 index 5977ced6f561..000000000000 --- a/devel/kyua-cli/files/patch-utils-config-tree.ipp +++ /dev/null @@ -1,55 +0,0 @@ ---- utils/config/tree.ipp.old -+++ utils/config/tree.ipp -@@ -79,13 +79,13 @@ config::tree::lookup(const std::string& dotted_key) const - { - const detail::tree_key key = detail::parse_key(dotted_key); - const detail::base_node* raw_node = _root->lookup_ro(key, 0); -- try { -- const LeafType& child = dynamic_cast< const LeafType& >(*raw_node); -- if (child.is_set()) -- return child.value(); -+ const LeafType* child = dynamic_cast< const LeafType* >(raw_node); -+ if (child != NULL) { -+ if (child->is_set()) -+ return child->value(); - else - throw unknown_key_error(key); -- } catch (const std::bad_cast& unused_error) { -+ } else { - throw unknown_key_error(key); - } - } -@@ -107,13 +107,13 @@ config::tree::lookup_rw(const std::string& dotted_key) - const detail::tree_key key = detail::parse_key(dotted_key); - detail::base_node* raw_node = _root->lookup_rw( - key, 0, detail::new_node< LeafType >); -- try { -- LeafType& child = dynamic_cast< LeafType& >(*raw_node); -- if (child.is_set()) -- return child.value(); -+ LeafType* child = dynamic_cast< LeafType* >(raw_node); -+ if (child != NULL) { -+ if (child->is_set()) -+ return child->value(); - else - throw unknown_key_error(key); -- } catch (const std::bad_cast& unused_error) { -+ } else { - throw unknown_key_error(key); - } - } -@@ -136,10 +136,10 @@ config::tree::set(const std::string& dotted_key, - const detail::tree_key key = detail::parse_key(dotted_key); - leaf_node* raw_node = _root->lookup_rw(key, 0, - detail::new_node< LeafType >); -- try { -- LeafType& child = dynamic_cast< LeafType& >(*raw_node); -- child.set(value); -- } catch (const std::bad_cast& unused_error) { -+ LeafType* child = dynamic_cast< LeafType* >(raw_node); -+ if (child != NULL) { -+ child->set(value); -+ } else { - throw value_error(F("Invalid value for key '%s'") % - detail::flatten_key(key)); - } |