glib, gkeyfile question



In gkeyfile.c, g_key_file_to_data() unconditionally
appends a newline between groups (the comment is
simply "separate groups by at least an empty line").
The resulting string is, therefore, different from the
original contents of the file, by 1 newline character
per group. If one writes back the contents of this
string to the original file, that file then grows.

I've read the bug at:

http://bugzilla.gnome.org/show_bug.cgi?id=344868

which explains why this was done. However, the
comment:

"Keyfiles written by g_key_file_to_data are a bit hard
to read since the groups aren't separated by empty
lines."

is only valid for key files that have the lack of
newlines anyway. In my view, the exact contents of the
original file should be maintained when calling
g_key_file_to_data.

If anyone agrees, I have a patch to remove the extra
newlines, and to test that g_key_file_to_data leaves
that data unchanged. If so, I'll reopen the bug and
add all this.

- Bobby


 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]