GNOME Bugzilla – Bug 476852
Invocation of the interface "g_key_file_remove_comment" does not remove comment in specific case
Last modified: 2018-05-24 11:05:46 UTC
Please describe the problem:
Invocation of the interface g_key_file_remove_comment with parameters group_name = "some_group", key = "NULL" does not remove comment above the group. This is caused by duality of the comment structure. In implementation of the "g_key_file_set_comment" interface used "comment" field of the structure, but when loading from file or data then the parsing used "NULL" key in the map.
Steps to reproduce:
1. Load a key file from data.
2. Call g_key_file_remove_comment with group "group_name" = "Second Group"(existing group in the key file), "key" = NULL. The correct behaviour is to remove the comment above the "Second Group" group, which contains "Third Comment" text.
3. Call g_key_file_get_comment with same parameters. If the comment is removed by the previous call the g_key_file_get_comment returns NULL. Otherwise the g_key_file_get_comment returns a text of the comment that demonstrates incorrect behaviour of the g_key_file_remove_comment.
"g_key_file_get_comment" returns the text of the comment.
The NULL should be returned when calling "g_key_file_get_comment".
Does this happen every time?
The detailed bug description can be found at:
Created attachment 95582 [details]
The test case reproducing the bug
-- GitLab Migration Automatic Message --
This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/104.