diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2012-01-13 11:29:49 -0500 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2012-02-21 11:52:26 -0500 |
commit | 389ad09a6fff55652fd30159c1008018187e4d77 (patch) | |
tree | d0dcd2e8e3abee84671e9d6004616b6228d57f72 /bus | |
parent | 55a9300f49ea5b711dbbf78870f3d9d400e3b662 (diff) |
ibus-daemon: Fix a matchrule parse issue.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/matchrule.c | 4 | ||||
-rw-r--r-- | bus/test-matchrule.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bus/matchrule.c b/bus/matchrule.c index 05c75995..992cfbe9 100644 --- a/bus/matchrule.c +++ b/bus/matchrule.c @@ -159,7 +159,7 @@ typedef struct _Token { } Token; #define SKIP_WHITE(a) \ - while (*(a) == ' ' || *(a) == '\t') { (a)++; } + while (*(a) == ' ' || *(a) == '\t' || *(a) == '\n') { (a)++; } #define IS_ALPHA(a) \ ((*(a) >= 'a' && *(a) <= 'z') || (*(a) >= 'A' && *(a) <= 'Z')) #define IS_NUMBER(a) \ @@ -269,7 +269,7 @@ tokenize_rule (const gchar *text) return (Token *)g_array_free (tokens, FALSE); failed: - + // g_debug("failed at: \"%s\"", p); for (i = 0; i < tokens->len; i++) { Token *p = &g_array_index (tokens, Token, i); g_free (p->key); diff --git a/bus/test-matchrule.c b/bus/test-matchrule.c index edd422c2..68395198 100644 --- a/bus/test-matchrule.c +++ b/bus/test-matchrule.c @@ -25,7 +25,8 @@ main(gint argc, gchar **argv) g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); g_object_unref (rule); - rule = bus_match_rule_new ("type='method_call', interface='org.freedesktop.IBus' "); + rule = bus_match_rule_new ("type='method_call' ,\n" + " interface='org.freedesktop.IBus' "); g_assert (rule->message_type == G_DBUS_MESSAGE_TYPE_METHOD_CALL); g_assert (g_strcmp0 (rule->interface, "org.freedesktop.IBus") == 0 ); g_object_unref (rule); |