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 613869 - go_conf_set_str_list behaviour on NULL list
go_conf_set_str_list behaviour on NULL list
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-03-25 07:08 UTC by Andreas J. Guelzow
Modified: 2010-03-26 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.29 KB, patch)
2010-03-25 10:14 UTC, Jean Bréfort
none Details | Review
Untested patch (604 bytes, patch)
2010-03-26 14:13 UTC, Morten Welinder
accepted-commit_now Details | Review

Description Andreas J. Guelzow 2010-03-25 07:08:55 UTC
In go-conf-keyfile.c we have:

void
go_conf_set_str_list (GOConfNode *node, gchar const *key, GSList *list)
{
	gchar *real_key;
	gchar **strs = NULL;
	int i, ns;

	/* eh? */
	if (list == NULL)
		return;

which makes it impossible to set a string list to teh empty list. This differs from the corresponding code in go-conf-gconf.c that allows NULL lists.
Comment 1 Jean Bréfort 2010-03-25 10:14:46 UTC
Created attachment 157045 [details] [review]
proposed patch
Comment 2 Morten Welinder 2010-03-25 12:23:05 UTC
How is that patch different from just removing the return-on-NULL?
Comment 3 Morten Welinder 2010-03-26 14:12:03 UTC
My copy of g_key_file_set_string_list (2.14.1) has this:

    g_return_if_fail (list != NULL);

so I don't see how that code can work.  git has 

    g_return_if_fail (list != NULL || length == 0);
Comment 4 Morten Welinder 2010-03-26 14:13:22 UTC
Created attachment 157170 [details] [review]
Untested patch

This ought to work, but has not been tested.  I'm not even sure gkeyfile
can truly handle the empty list.
Comment 5 Andreas J. Guelzow 2010-03-26 15:37:27 UTC
Review of attachment 157170 [details] [review]:

This appears to work well.
Comment 6 Morten Welinder 2010-03-26 15:53:35 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.