mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
Set length out param in list-returning functions to 0 when returning NULL.
2007-11-22 Matthias Clasen <mclasen@redhat.com> * glib/gkeyfile.c: Set length out param in list-returning functions to 0 when returning NULL. (#498728, Christian Persch) svn path=/trunk/; revision=5915
This commit is contained in:
parent
1e55738f31
commit
ccf93c8693
@ -1,3 +1,8 @@
|
|||||||
|
2007-11-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gkeyfile.c: Set length out param in list-returning functions
|
||||||
|
to 0 when returning NULL. (#498728, Christian Persch)
|
||||||
|
|
||||||
2007-11-21 21:06:47 Tim Janik <timj@imendio.com>
|
2007-11-21 21:06:47 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* Makefile.decl: initialize automake variables EXTRA_DIST and
|
* Makefile.decl: initialize automake variables EXTRA_DIST and
|
||||||
|
@ -1462,6 +1462,9 @@ g_key_file_get_string_list (GKeyFile *key_file,
|
|||||||
g_return_val_if_fail (group_name != NULL, NULL);
|
g_return_val_if_fail (group_name != NULL, NULL);
|
||||||
g_return_val_if_fail (key != NULL, NULL);
|
g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
|
||||||
|
if (length)
|
||||||
|
*length = 0;
|
||||||
|
|
||||||
value = g_key_file_get_value (key_file, group_name, key, &key_file_error);
|
value = g_key_file_get_value (key_file, group_name, key, &key_file_error);
|
||||||
|
|
||||||
if (key_file_error)
|
if (key_file_error)
|
||||||
@ -1744,7 +1747,11 @@ g_key_file_get_locale_string_list (GKeyFile *key_file,
|
|||||||
g_propagate_error (error, key_file_error);
|
g_propagate_error (error, key_file_error);
|
||||||
|
|
||||||
if (!value)
|
if (!value)
|
||||||
return NULL;
|
{
|
||||||
|
if (length)
|
||||||
|
*length = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (value[strlen (value) - 1] == ';')
|
if (value[strlen (value) - 1] == ';')
|
||||||
value[strlen (value) - 1] = '\0';
|
value[strlen (value) - 1] = '\0';
|
||||||
@ -1940,6 +1947,9 @@ g_key_file_get_boolean_list (GKeyFile *key_file,
|
|||||||
g_return_val_if_fail (group_name != NULL, NULL);
|
g_return_val_if_fail (group_name != NULL, NULL);
|
||||||
g_return_val_if_fail (key != NULL, NULL);
|
g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
|
||||||
|
if (length)
|
||||||
|
*length = 0;
|
||||||
|
|
||||||
key_file_error = NULL;
|
key_file_error = NULL;
|
||||||
|
|
||||||
values = g_key_file_get_string_list (key_file, group_name, key,
|
values = g_key_file_get_string_list (key_file, group_name, key,
|
||||||
@ -2152,6 +2162,9 @@ g_key_file_get_integer_list (GKeyFile *key_file,
|
|||||||
g_return_val_if_fail (group_name != NULL, NULL);
|
g_return_val_if_fail (group_name != NULL, NULL);
|
||||||
g_return_val_if_fail (key != NULL, NULL);
|
g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
|
||||||
|
if (length)
|
||||||
|
*length = 0;
|
||||||
|
|
||||||
values = g_key_file_get_string_list (key_file, group_name, key,
|
values = g_key_file_get_string_list (key_file, group_name, key,
|
||||||
&num_ints, &key_file_error);
|
&num_ints, &key_file_error);
|
||||||
|
|
||||||
@ -2361,6 +2374,9 @@ g_key_file_get_double_list (GKeyFile *key_file,
|
|||||||
g_return_val_if_fail (group_name != NULL, NULL);
|
g_return_val_if_fail (group_name != NULL, NULL);
|
||||||
g_return_val_if_fail (key != NULL, NULL);
|
g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
|
||||||
|
if (length)
|
||||||
|
*length = 0;
|
||||||
|
|
||||||
values = g_key_file_get_string_list (key_file, group_name, key,
|
values = g_key_file_get_string_list (key_file, group_name, key,
|
||||||
&num_doubles, &key_file_error);
|
&num_doubles, &key_file_error);
|
||||||
|
|
||||||
@ -3322,7 +3338,7 @@ g_key_file_is_key_name (const gchar *name)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* We accept spaces in the middle of keys to not break
|
/* We accept spaces in the middle of keys to not break
|
||||||
* existing apps, but we don't tolerate initial of final
|
* existing apps, but we don't tolerate initial or final
|
||||||
* spaces, which would lead to silent corruption when
|
* spaces, which would lead to silent corruption when
|
||||||
* rereading the file.
|
* rereading the file.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user