diff options
author | Miguel de Icaza <miguel@gnome.org> | 2006-10-18 04:00:14 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2006-10-18 04:00:14 +0400 |
commit | 2dc02d3a3468d827566ee57e1e8bf881981da7a9 (patch) | |
tree | f2a75bb07440cad56780b0ef6bddf50197c1480f /eglib | |
parent | 402dc2b092a802d9ce96222bfe87d81013a17a77 (diff) |
2006-10-17 Miguel de Icaza <miguel@novell.com>
* src/gmarkup.c (g_markup_parse_context_parse): Accept dots in
* the
sequence, reset the state after a closing element.
svn path=/trunk/mono/; revision=66775
Diffstat (limited to 'eglib')
-rw-r--r-- | eglib/ChangeLog | 3 | ||||
-rw-r--r-- | eglib/src/gmarkup.c | 13 | ||||
-rw-r--r-- | eglib/test/markup.c | 8 |
3 files changed, 18 insertions, 6 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog index 9f4af57f3ad..b75ceb729cb 100644 --- a/eglib/ChangeLog +++ b/eglib/ChangeLog @@ -1,5 +1,8 @@ 2006-10-17 Miguel de Icaza <miguel@novell.com> + * src/gmarkup.c (g_markup_parse_context_parse): Accept dots in the + sequence, reset the state after a closing element. + * src/garray.c (g_array_insert_vals): Shift the elements the correct amount. diff --git a/eglib/src/gmarkup.c b/eglib/src/gmarkup.c index 4c8e81d18b9..e81ff556702 100644 --- a/eglib/src/gmarkup.c +++ b/eglib/src/gmarkup.c @@ -238,7 +238,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, for (p = text; p < end; p++){ char c = *p; - + switch (context->state){ case START: if (c == ' ' || c == '\t' || c == '\f' || c == '\n') @@ -275,7 +275,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, goto fail; } - for (++p; p < end && isalnum (*p); p++) + for (++p; p < end && (isalnum (*p) || (*p == '.')); p++) ; if (p == end){ set_error ("Expected an element"); @@ -332,8 +332,9 @@ g_markup_parse_context_parse (GMarkupParseContext *context, } } free (ename); - } else + } else { context->level = g_slist_prepend (context->level, ename); + } context->state = TEXT; break; @@ -387,7 +388,6 @@ g_markup_parse_context_parse (GMarkupParseContext *context, goto fail; } text = current->data; - if (context->parser.end_element != NULL){ context->parser.end_element (context, text, context->user_data, error); if (error != NULL && *error != NULL){ @@ -396,9 +396,10 @@ g_markup_parse_context_parse (GMarkupParseContext *context, } } free (text); - + context->level = context->level->next; g_slist_free_1 (current); + context->state = FLUSH_TEXT; break; } /* case CLOSING_ELEMENT */ @@ -408,7 +409,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, return TRUE; fail: - if (context->parser.error) + if (context->parser.error && *error) context->parser.error (context, *error, context->user_data); destroy_parse_state (context); diff --git a/eglib/test/markup.c b/eglib/test/markup.c index 2cd72d158e6..9a38d3ee1df 100644 --- a/eglib/test/markup.c +++ b/eglib/test/markup.c @@ -194,10 +194,18 @@ mono_domain (void) return NULL; } +RESULT +mcs_config (void) +{ + return markup_test ("<configuration>\r\n <system.diagnostics>\r\n <trace autoflush=\"true\" indentsize=\"4\">\r\n <listeners>\r\n <add name=\"compilerLogListener\" type=\"System.Diagnostics.TextWriterTraceListener,System\"/> </listeners> </trace> </system.diagnostics> </configuration>"); + +} + static Test markup_tests [] = { {"invalid_documents", invalid_documents}, {"good_documents", valid_documents}, {"mono_domain", mono_domain}, + {"mcs_config", mcs_config}, {NULL, NULL} }; |