changeset 3361:e7d8727fb901 trunk

fixed a tuple parser bug, expression depth level wasn't correctly updated in certain nested situations
author Giacomo Lozito <james@develia.org>
date Sat, 18 Aug 2007 02:45:06 +0200
parents 8430c3911856
children 9da616784f11
files src/audacious/tuple_formatter.c
diffstat 1 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/tuple_formatter.c	Sat Aug 18 00:31:51 2007 +0200
+++ b/src/audacious/tuple_formatter.c	Sat Aug 18 02:45:06 2007 +0200
@@ -124,16 +124,19 @@
                         level++;
                     }
                 }
-                else if (*iter == '}' && (sel == argument))
+                else if (*iter == '}')
                 {
                     level--;
-                    if (level == 0)
-                      break;
+                    if (sel == argument)
+                    {
+                        if (level == 0)
+                            break;
+                        else
+                            g_string_append_c(sel, *iter);
+                    }
                     else
-                      g_string_append_c(sel, *iter);
+                        break;
                 }
-                else if (*iter == '}' && ((sel != argument)))
-                    break;
                 else
                     g_string_append_c(sel, *iter);
             }
@@ -188,16 +191,19 @@
                         level++;
                     }
                 }
-                else if (*iter == '}' && (sel == argument))
+                else if (*iter == '}')
                 {
                     level--;
-                    if (level == 0)
-                      break;
+                    if (sel == argument)
+                    {
+                        if (level == 0)
+                            break;
+                        else
+                            g_string_append_c(sel, *iter);
+                    }
                     else
-                    g_string_append_c(sel, *iter);
+                        break;
                 }
-                else if (*iter == '}' && ((sel != argument)))
-                    break;
                 else
                     g_string_append_c(sel, *iter);
             }