After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 479725 - The "g_key_file_get_comment" interface returns comment with unexpected new line symbol at the end
The "g_key_file_get_comment" interface returns comment with unexpected new li...
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gkeyfile
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-09-24 07:44 UTC by Areg Beketovski
Modified: 2018-05-24 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The test case reproducing the bug (442 bytes, text/plain)
2007-09-24 07:45 UTC, Areg Beketovski
  Details
gkeyfile: Fix parsing of new lines in comments (6.07 KB, patch)
2018-02-02 16:41 UTC, Philip Withnall
none Details | Review

Description Areg Beketovski 2007-09-24 07:44:17 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
Comment 1 Areg Beketovski 2007-09-24 07:45:27 UTC
Created attachment 96101 [details]
The test case reproducing the bug
Comment 2 Philip Withnall 2018-02-02 16:41:59 UTC
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>
Comment 3 GNOME Infrastructure Team 2018-05-24 11:06:29 UTC
-- 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.