Author: spouliot
Date: 2007-09-27 10:50:08 -0400 (Thu, 27 Sep 2007)
New Revision: 86502

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/xaml.cpp
Log:
xaml.cpp: Don't freak out if <?xml ... ?> isn't on the first line. Fix bug 
#328907.

Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-09-27 14:40:44 UTC (rev 86501)
+++ trunk/moon/src/ChangeLog    2007-09-27 14:50:08 UTC (rev 86502)
@@ -1,3 +1,8 @@
+2007-09-27  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * xaml.cpp: Don't freak out if <?xml ... ?> isn't on the first 
+       line. Fix bug #328907.
+
 2007-09-27  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * control.h, control.cpp: Added control_initialize_from_xaml_callbacks, 
and

Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp     2007-09-27 14:40:44 UTC (rev 86501)
+++ trunk/moon/src/xaml.cpp     2007-09-27 14:50:08 UTC (rev 86502)
@@ -1131,6 +1131,7 @@
        XML_Parser p = XML_ParserCreateNS (NULL, '|');
        XamlParserInfo *parser_info = NULL;
        DependencyObject *res = NULL;
+       char *start = (char*)xaml;
 
        if (!p) {
 #ifdef DEBUG_XAML
@@ -1158,8 +1159,10 @@
        XML_SetProcessingInstructionHandler (p, proc_handler);
        */
 
+       // don't freak out if the <?xml ... ?> isn't on the first line (see 
#328907)
+       for (; *start && isspace (*start); start++);
 
-       if (!XML_Parse (p, xaml, strlen (xaml), TRUE)) {
+       if (!XML_Parse (p, start, strlen (start), TRUE)) {
                parser_error (parser_info, NULL, NULL, g_strdup_printf 
(XML_ErrorString (XML_GetErrorCode (p))));
                printf ("error parsing:  %s\n\n", xaml);
                goto cleanup_and_return;

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

Reply via email to