+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
+2002-05-18 Matthias Clasen <maclas@gmx.de>
+
+ * tests/markups/fail-36.gmarkup:
+ * tests/markups/fail-35.gmarkup:
+ * tests/markups/valid-8.gmarkup:
+ * tests/markups/valid-7.gmarkup:
+ * tests/markups/valid-6.gmarkup:
+ * tests/markups/valid-5.gmarkup: New testcases.
+
+ * tests/markup-test.c (passthrough_handler):
+ (text_handler): Don't ignore the text_len parameter.
+
+ * glib/gmarkup.c (find_current_text_end): Don't hang on embedded
+ nuls. (#81977)
+ (g_markup_parse_context_parse): Fix passthrough handling to
+ correctly skip processing instructions, comments, doctype
+ declarations and CDATA marked sections. (#81977)
+
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
guint document_empty : 1;
guint parsing : 1;
+ gint balance;
};
/**
context->document_empty = TRUE;
context->parsing = FALSE;
+ context->balance = 0;
+
return context;
}
p = context->current_text;
next = g_utf8_find_next_char (p, end);
- while (next)
+ while (next && *next)
{
+ if (p == next)
+ next++;
p = next;
next = g_utf8_find_next_char (p, end);
}
const gchar *openangle = "<";
add_to_partial (context, openangle, openangle + 1);
context->start = context->iter;
+ context->balance = 1;
context->state = STATE_INSIDE_PASSTHROUGH;
}
else if (*context->iter == '/')
g_free (close_name);
}
break;
-
+
case STATE_INSIDE_PASSTHROUGH:
/* Possible next state: AFTER_CLOSE_ANGLE */
do
{
- if (*context->iter == '>')
- break;
+ if (*context->iter == '<')
+ context->balance++;
+ if (*context->iter == '>')
+ {
+ context->balance--;
+ add_to_partial (context, context->start, context->iter);
+ context->start = context->iter;
+ if ((g_str_has_prefix (context->partial_chunk->str, "<?")
+ && g_str_has_suffix (context->partial_chunk->str, "?")) ||
+ (g_str_has_prefix (context->partial_chunk->str, "<!--")
+ && g_str_has_suffix (context->partial_chunk->str, "--")) ||
+ (g_str_has_prefix (context->partial_chunk->str, "<![CDATA[")
+ && g_str_has_suffix (context->partial_chunk->str, "]]")) ||
+ (g_str_has_prefix (context->partial_chunk->str, "<!DOCTYPE")
+ && context->balance == 0))
+ break;
+ }
}
while (advance_char (context));
GError **error)
{
indent (0);
- printf ("TEXT '%s'\n", text);
+ printf ("TEXT '%.*s'\n", (int)text_len, text);
}
{
indent (0);
- printf ("PASS '%s'\n", passthrough_text);
+ printf ("PASS '%.*s'\n", (int)text_len, passthrough_text);
}
static void
return 1;
}
}
+
--- /dev/null
+<foo>gedit&</foo>
--- /dev/null
+<?xml version="1.0" ?>
+<foo></foo>
--- /dev/null
+<!DOCTYPE foo "foo" [
+<!ELEMENT foo ANY >
+]>
+<foo></foo>
--- /dev/null
+<!-- a comment -->
+<foo></foo>
--- /dev/null
+<foo><![CDATA[ some <<<<>>>> CDATA ]]></foo>
for I in $srcdir/markups/fail-*.gmarkup; do
echo "Parsing $I, should fail"
./markup-test $I > /dev/null && fail "failed to generate error on $I"
+ if test "$?" != "1"; then
+ fail "unexpected error on $I"
+ fi
done
for I in $srcdir/markups/valid-*.gmarkup; do