[glib/glib-2-24] GVariant: fix for g_variant_iter_loop() (cherry picked from commit d17f4bee175cd9149d5f2b1ed1ae6d262
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-24] GVariant: fix for g_variant_iter_loop() (cherry picked from commit d17f4bee175cd9149d5f2b1ed1ae6d262
- Date: Mon, 3 May 2010 00:58:37 +0000 (UTC)
commit 7fb9b876fa6ec63c05df1c5e441bcc87e48397e2
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Apr 14 23:35:56 2010 -0400
GVariant: fix for g_variant_iter_loop()
(cherry picked from commit d17f4bee175cd9149d5f2b1ed1ae6d262d6a1394)
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]