GKeyFile: allow loading from empty strings
authorRyan Lortie <desrt@desrt.ca>
Thu, 26 Jan 2012 16:27:47 +0000 (11:27 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 26 Jan 2012 19:40:34 +0000 (14:40 -0500)
commit9bfde4a53fbc7c5596c65c790b76e61aae88860d
tree932cea6c804bd6b8e3f751a3c5af459750e9c9eb
parentbc40fe582d63e75c0e7f9dae44808ecc924e3f7e
GKeyFile: allow loading from empty strings

GKeyFile supports empty files and also supports loading from the string
"", but will fail with a critical if you try:

  - explicit length == 0
  - data == NULL

length == 0 should always be valid, and data == NULL should be valid in
the case that length == 0, so add some testcases for those and fix the
code up to allow them.

https://bugzilla.gnome.org/show_bug.cgi?id=668756
glib/gkeyfile.c
glib/tests/keyfile.c