r6897 - dumbhippo/trunk/client/common/ddm



Author: otaylor
Date: 2007-11-12 15:36:49 -0600 (Mon, 12 Nov 2007)
New Revision: 6897

Modified:
   dumbhippo/trunk/client/common/ddm/ddm-condition-parser.c
   dumbhippo/trunk/client/common/ddm/ddm-data-model.c
   dumbhippo/trunk/client/common/ddm/test-condition-parser.c
Log:
ddm-condition-parser.c test-condition-parser.c: Fix a bug parsing
  parenthesed sub-expressions.
ddm-data-model.c: Move a comment to the right place




Modified: dumbhippo/trunk/client/common/ddm/ddm-condition-parser.c
===================================================================
--- dumbhippo/trunk/client/common/ddm/ddm-condition-parser.c	2007-11-12 21:09:43 UTC (rev 6896)
+++ dumbhippo/trunk/client/common/ddm/ddm-condition-parser.c	2007-11-12 21:36:49 UTC (rev 6897)
@@ -284,6 +284,8 @@
             if (i == -1) {
                 have_error = TRUE;
                 goto out;
+            } else if (i == len) {
+                break;
             }
         }
         
@@ -340,6 +342,8 @@
             if (i == -1) {
                 have_error = TRUE;
                 goto out;
+            } else if (i == len) {
+                break;
             }
         }
         

Modified: dumbhippo/trunk/client/common/ddm/ddm-data-model.c
===================================================================
--- dumbhippo/trunk/client/common/ddm/ddm-data-model.c	2007-11-12 21:09:43 UTC (rev 6896)
+++ dumbhippo/trunk/client/common/ddm/ddm-data-model.c	2007-11-12 21:36:49 UTC (rev 6897)
@@ -868,12 +868,12 @@
     if (source_rules) {
         source_rules = g_slist_prepend(source_rules, rule);
         g_hash_table_insert(model->rules_by_source,
-                            (char *)source_class_id,
+                            (char *)source_class_id, /* old value is kept */
                             source_rules);
     } else {
         source_rules = g_slist_prepend(NULL, rule);
         g_hash_table_insert(model->rules_by_source,
-                            g_strdup(source_class_id), /* old value is kept */
+                            g_strdup(source_class_id),
                             source_rules);
     }
 }

Modified: dumbhippo/trunk/client/common/ddm/test-condition-parser.c
===================================================================
--- dumbhippo/trunk/client/common/ddm/test-condition-parser.c	2007-11-12 21:09:43 UTC (rev 6896)
+++ dumbhippo/trunk/client/common/ddm/test-condition-parser.c	2007-11-12 21:36:49 UTC (rev 6897)
@@ -54,6 +54,7 @@
     do_test("false", "false");
     do_test("target.a = 1 and target.b = 2 or not source.c = 3",
             "(target.a = 1 and target.b = 2) or (not source.c = 3)");
+    do_test_i("(source.aim = target.name and target.protocol = \"aim\") or (source.xmpp = target.name and target.protocol = \"xmpp\")");
     
     return result ? 0 : 1;
 }



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