Opened 12 years ago
Closed 8 years ago
#4973 closed Bugs (fixed)
ini_parser.hpp doesn't handle sections correctly
| Reported by: | Owned by: | Sebastian Redl | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | property_tree |
| Version: | Boost 1.45.0 | Severity: | Problem |
| Keywords: | Cc: | prabhu.swain@… |
Description
ptree pt;
pt.put("debug.filename", "tst.log");
pt.put("other", "tst");
"other" is correctly put in no section
boost::property_tree::write_ini("tst.ini", pt);
boost::property_tree::read_ini("tst.ini", pt);
"other" is now suddenly in "debug" section
Change History (5)
comment:1 by , 12 years ago
| Component: | None → property_tree |
|---|---|
| Owner: | set to |
comment:2 by , 12 years ago
| Cc: | added |
|---|
comment:3 by , 11 years ago
comment:5 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Merged to master in commit 3befb8cbe4.
Note:
See TracTickets
for help on using tickets.

--- ini_parser.hpp 2011-12-14 12:15:22.000000000 -0500 +++ inix_parser.hpp 2011-12-14 12:12:45.000000000 -0500 @@ -238,7 +238,14 @@ namespace boost { namespace property_tre << it->second.template get_value< std::basic_string<Ch> >() << Ch('\n'); - } else { + } + } + + for (typename Ptree::const_iterator it = pt.begin(), end = pt.end(); + it != end; ++it) + { + check_dupes(it->second); + if (!it->second.empty()) { if (!it->second.data().empty()) BOOST_PROPERTY_TREE_THROW(ini_parser_error( "mixed data and children", "", 0));