The use case here is of course modification of an existing ini file. IMO, the expected output would be the addition of the new section property in the pre-existing section, such as
instead of duplicating the section at the bottom with the new property. In this manner, it seems the library does not properly support the addition of new properties in pre-existing sections that are not last in the file, only modification of such section's pre-existing properties. The output above is invalid as many parsers will throw a duplicate section error.
Given a file with contents
the following code
will result in
The use case here is of course modification of an existing ini file. IMO, the expected output would be the addition of the new section property in the pre-existing section, such as
instead of duplicating the section at the bottom with the new property. In this manner, it seems the library does not properly support the addition of new properties in pre-existing sections that are not last in the file, only modification of such section's pre-existing properties. The output above is invalid as many parsers will throw a duplicate section error.