Author: miguel
Date: 2006-10-17 20:00:14 -0400 (Tue, 17 Oct 2006)
New Revision: 66775

Modified:
   trunk/mono/eglib/ChangeLog
   trunk/mono/eglib/src/gmarkup.c
   trunk/mono/eglib/test/markup.c
Log:
2006-10-17  Miguel de Icaza  <[EMAIL PROTECTED]>

        * src/gmarkup.c (g_markup_parse_context_parse): Accept dots in
        * the
        sequence, reset the state after a closing element.



Modified: trunk/mono/eglib/ChangeLog
===================================================================
--- trunk/mono/eglib/ChangeLog  2006-10-17 23:48:12 UTC (rev 66774)
+++ trunk/mono/eglib/ChangeLog  2006-10-18 00:00:14 UTC (rev 66775)
@@ -1,5 +1,8 @@
 2006-10-17  Miguel de Icaza  <[EMAIL PROTECTED]>
 
+       * 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.
 

Modified: trunk/mono/eglib/src/gmarkup.c
===================================================================
--- trunk/mono/eglib/src/gmarkup.c      2006-10-17 23:48:12 UTC (rev 66774)
+++ trunk/mono/eglib/src/gmarkup.c      2006-10-18 00:00:14 UTC (rev 66775)
@@ -238,7 +238,7 @@
        
        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 @@
                                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 @@
                                        }
                                }
                                free (ename);
-                       } else
+                       } else {
                                context->level = g_slist_prepend 
(context->level, ename);
+                       }
                        
                        context->state = TEXT;
                        break;
@@ -387,7 +388,6 @@
                                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 @@
                                }
                        }
                        free (text);
-                       
+
                        context->level = context->level->next;
                        g_slist_free_1 (current);
+                       context->state = FLUSH_TEXT;
                        break;
                } /* case CLOSING_ELEMENT */
                        
@@ -408,7 +409,7 @@
 
        return TRUE;
  fail:
-       if (context->parser.error)
+       if (context->parser.error && *error)
                context->parser.error (context, *error, context->user_data);
        
        destroy_parse_state (context);

Modified: trunk/mono/eglib/test/markup.c
===================================================================
--- trunk/mono/eglib/test/markup.c      2006-10-17 23:48:12 UTC (rev 66774)
+++ trunk/mono/eglib/test/markup.c      2006-10-18 00:00:14 UTC (rev 66775)
@@ -194,10 +194,18 @@
        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}
 };
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to