2006-10-17 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 18 Oct 2006 00:00:14 +0000 (00:00 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 18 Oct 2006 00:00:14 +0000 (00:00 -0000)
        * 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

eglib/ChangeLog
eglib/src/gmarkup.c
eglib/test/markup.c

index 9f4af57f3addf101b3418d1515f875c19216a86c..b75ceb729cba55abf5490ecc58f79d2b8a5cfb03 100644 (file)
@@ -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.
 
index 4c8e81d18b9163e99ba9447b6f0c238b26d712e1..e81ff556702676c72acaea05a2214dc3ad1a0c75 100644 (file)
@@ -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);
index 2cd72d158e6538c2145cb3e87b0015944c722f91..9a38d3ee1df18693364d6650b02affdb457e3d94 100644 (file)
@@ -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}
 };