[glib] Accept NULL as empty string list



commit 2dfce324220bf7e1ea5ca465a74e58cf8146b808
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 2 22:41:19 2009 -0400

    Accept NULL as empty string list
    
    Fixes bug 580656.
---
 glib/gkeyfile.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c
index 19301ce..16939a9 100644
--- a/glib/gkeyfile.c
+++ b/glib/gkeyfile.c
@@ -1559,7 +1559,7 @@ g_key_file_get_string_list (GKeyFile     *key_file,
  * @length: number of string values in @list
  *
  * Associates a list of string values for @key under @group_name.
- * If @key cannot be found then it is created.  
+ * If @key cannot be found then it is created.
  * If @group_name cannot be found then it is created.
  *
  * Since: 2.6
@@ -1575,7 +1575,7 @@ g_key_file_set_string_list (GKeyFile            *key_file,
   gsize i;
 
   g_return_if_fail (key_file != NULL);
-  g_return_if_fail (list != NULL);
+  g_return_if_fail (list != NULL || length == 0);
 
   value_list = g_string_sized_new (length * 128);
   for (i = 0; i < length && list[i] != NULL; i++)
@@ -1601,7 +1601,7 @@ g_key_file_set_string_list (GKeyFile            *key_file,
  * @locale: a locale identifier
  * @string: a string
  *
- * Associates a string value for @key and @locale under @group_name.  
+ * Associates a string value for @key and @locale under @group_name.
  * If the translation for @key cannot be found then it is created.
  *
  * Since: 2.6



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