]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug in ParameterHandler where parameter entries with "value" key where incorrec...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 31 Mar 2013 20:38:01 +0000 (20:38 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 31 Mar 2013 20:38:01 +0000 (20:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@29123 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/parameter_handler.cc

index cacee191a2df829cc14bb63243f49b145eb1bd82..40c512cce1574da779a5a1bb32874ecb3f1cd143 100644 (file)
@@ -1228,7 +1228,14 @@ ParameterHandler::demangle (const std::string &s)
 bool
 ParameterHandler::is_parameter_node (const boost::property_tree::ptree &p)
 {
-  return (p.get_optional<std::string>("value"));
+  // A parameter node must have a value key
+  if (p.get_optional<std::string>("value"))
+    {
+      // and the associated child ptree must be final, i.e. no children:
+      if(p.get_child("value").size() == 0)
+        return true;
+    }
+  return false;
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.