GNOME Bugzilla – Bug 613869
go_conf_set_str_list behaviour on NULL list
Last modified: 2010-03-26 15:53:35 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.
Created attachment 157045 [details] [review] proposed patch
How is that patch different from just removing the return-on-NULL?
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);
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.
Review of attachment 157170 [details] [review]: This appears to work well.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.