GNOME Bugzilla – Bug 479725
The "g_key_file_get_comment" interface returns comment with unexpected new line symbol at the end
Last modified: 2018-05-24 11:06:29 UTC
Invocation of the interface g_key_file_get_comment returns comment with added new line symbol at the end. This is caused by inner function "g_key_file_parse_value_as_comment" which adds '\n' symbol at the end of the comment. The detailed bug description can be found at: http://linuxtesting.org/results/report?num=D0025
Created attachment 96101 [details] The test case reproducing the bug
Created attachment 367833 [details] [review] gkeyfile: Fix parsing of new lines in comments Previously, the code which parsed comments in key files would append a line break to the comment where there was none before; this was part of the code for handling re-inserting line breaks into multi-line comments after removing the ‘#’ prefix. Now, we don’t add a terminal line break. This was slightly icky to implement because parse_value_as_comment() is called once for each line of a multi-line comment. This expands the existing test case to cover a single line comment, and also fixes the documentation to correctly state that the leading ‘#’ *is* removed and mention the new line break behaviour. Signed-off-by: Philip Withnall <withnall@endlessm.com>
-- 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/107.