[glib] GVariant: fix for g_variant_iter_loop()
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GVariant: fix for g_variant_iter_loop()
- Date: Thu, 15 Apr 2010 03:39:16 +0000 (UTC)
commit d17f4bee175cd9149d5f2b1ed1ae6d262d6a1394
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Apr 14 23:35:56 2010 -0400
GVariant: fix for g_variant_iter_loop()
glib/gvariant.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index f8f29e0..5948ccd 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -3473,17 +3473,21 @@ g_variant_valist_get (const gchar **str,
else /* tuple, dictionary entry */
{
- GVariantIter iter;
+ gint index = 0;
g_assert (**str == '(' || **str == '{');
- g_variant_iter_init (&iter, value);
(*str)++;
while (**str != ')' && **str != '}')
{
- value = g_variant_iter_next_value (&iter);
- g_variant_valist_get (str, value, free, app);
- g_variant_unref (value);
+ if (value != NULL)
+ {
+ GVariant *child = g_variant_get_child_value (value, index++);
+ g_variant_valist_get (str, child, free, app);
+ g_variant_unref (child);
+ }
+ else
+ g_variant_valist_get (str, NULL, free, app);
}
(*str)++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]