Displaying 10 results from an estimated 10 matches for "swfdec_xml_unescape_len".
2007 Oct 14
0
5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h
...fdec/swfdec_html_parser.c
index 3c0ca04..cba7aa7 100644
--- a/libswfdec/swfdec_html_parser.c
+++ b/libswfdec/swfdec_html_parser.c
@@ -339,7 +339,7 @@ swfdec_text_field_movie_html_parse_text (ParserData *data, const char *p,
end = p + strcspn (p, "<\n");
}
- unescaped = swfdec_xml_unescape_len (p, end - p);
+ unescaped = swfdec_xml_unescape_len (data->cx, p, end - p);
data->text = g_string_append (data->text, unescaped);
g_free (unescaped);
diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c
index a710f15..c3c2e44 100644
--- a/libswfdec/swfdec_xml.c
+++ b...
2007 Dec 23
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_character.c libswfdec/swfdec_external_interface.c libswfdec/swfdec.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h
...ernalInterface._unescapeXML (static)");
+ const char *s;
+
+ if (argc == 0 ||
+ (s = swfdec_as_value_to_string (cx, &argv[0])) == SWFDEC_AS_STR_EMPTY) {
+ SWFDEC_AS_VALUE_SET_NULL (ret);
+ return;
+ }
+
+ SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx,
+ swfdec_xml_unescape_len (cx, s, strlen (s), FALSE)));
}
SWFDEC_AS_NATIVE (14, 7, swfdec_external_interface__jsQuoteString)
@@ -92,17 +128,51 @@ swfdec_external_interface__jsQuoteString (SwfdecAsContext *cx,
SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
SwfdecAsValue *ret)
{
- SWFDEC_STUB ("...
2007 Oct 13
0
5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_xml.c test/trace
...;);
+ // Note: we don't escape non-breaking space to
p = start = orginal;
while (*(p += strcspn (p, "&<>\"'")) != '\0' && p - orginal < length) {
string = g_string_append_len (string, start, p - start);
@@ -129,6 +131,9 @@ swfdec_xml_unescape_len (const char *org
for (i = 0; xml_entities[i].escaped != NULL; i++) {
if (!g_ascii_strncasecmp (p, xml_entities[i].escaped,
strlen (xml_entities[i].escaped))) {
+ // FIXME: Do this cleaner
+ if (xml_entities[i].character == '\xa0')
+ string = g_string_append_c (string, ...
2007 Oct 31
0
5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_audio.c libswfdec/swfdec_sound.c libswfdec/swfdec_xml.c
...iki.fi>
Date: Wed Oct 31 12:08:50 2007 +0200
Fix a mistake in swfdec_xml_unescape leading to invalid UTF-8 on version 5
diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c
index f447e46..37174bc 100644
--- a/libswfdec/swfdec_xml.c
+++ b/libswfdec/swfdec_xml.c
@@ -133,7 +133,7 @@ swfdec_xml_unescape_len (SwfdecAsContext *cx, const char *orginal,
if (!g_ascii_strncasecmp (p, xml_entities[i].escaped,
strlen (xml_entities[i].escaped))) {
// FIXME: Do this cleaner
- if (cx->version > 5 && xml_entities[i].character == '\xa0')
+ if (xml_entities[i].character == '...
2008 Jan 07
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_types.c libswfdec/swfdec_xml.c
...th memchr in XML unescaping
This helps a lot when the given string is 11MB long and we only unescape 5
characters.
diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c
index 70b3924..afcf618 100644
--- a/libswfdec/swfdec_xml.c
+++ b/libswfdec/swfdec_xml.c
@@ -121,13 +121,14 @@ swfdec_xml_unescape_len (SwfdecAsContext *cx, const char *orginal,
gssize length, gboolean unescape_nbsp)
{
int i;
- const char *p, *start;
+ const char *p, *start, *end;
GString *string;
string = g_string_new ("");
p = start = orginal;
- while ((p = strchr (p, '&')) != NULL...
2008 Jan 19
0
11 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h test/image test/swfdec_test.c test/swfdec_test_image.c test/trace
...l_if_fail (SWFDEC_IS_XML (xml), strchr (p, '\0'));
g_return_val_if_fail (SWFDEC_IS_XML_NODE (node), strchr (p, '\0'));
@@ -538,13 +538,18 @@ swfdec_xml_parse_attribute (SwfdecXml *xml, SwfdecXmlNode *node, const char *p)
return strchr (p, '\0');
}
- unescaped = swfdec_xml_unescape_len (SWFDEC_AS_OBJECT (xml)->context, p + 1,
- end - (p + 1), TRUE);
- value = swfdec_as_context_give_string (SWFDEC_AS_OBJECT (node)->context,
- unescaped);
- SWFDEC_AS_VALUE_SET_STRING (&val, value);
+ if (!swfdec_as_object_get_variable (node->attributes, name, NULL)) {
+...
2007 Oct 22
0
12 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
...) {
+ while (*p != '\0' && *p != '<') {
+ if (data->condense_white) {
end = p + strcspn (p, "< \n\r\t");
+ } else {
+ end = strchr (p, '<');
+ if (end == NULL)
+ end = strchr (p, '\0');
+ }
- unescaped = swfdec_xml_unescape_len (data->cx, p, end - p);
- data->text = g_string_append (data->text, unescaped);
- g_free (unescaped);
+ unescaped = swfdec_xml_unescape_len (data->cx, p, end - p);
+ data->text = g_string_append (data->text, unescaped);
+ g_free (unescaped);
- if (g_ascii...
2007 Nov 15
2
Changes to 'refs/tags/0.5.4'
Tag '0.5.4' created by Benjamin Otte <otte at gnome.org> at 2007-11-15 10:12 -0800
release 0.5.4 ("Turkish Cycling Federation")
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQBHPBurvMv5VCdLq8QRAj1KAJ40NHRRS3gKyJjSjyyoH7gDaGi/tQCeOha/
R5PF4bZQqmSdJ64t8EbD4cA=
=8qBy
-----END PGP SIGNATURE-----
Changes since the dawn of time:
Benjamin Otte (40):
2007 Oct 29
0
20 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h
...space
- while (*p != '\0' && *p != '<') {
- if (data->condense_white) {
- end = p + strcspn (p, "< \n\r\t");
- } else {
- end = strchr (p, '<');
- if (end == NULL)
- end = strchr (p, '\0');
- }
-
- unescaped = swfdec_xml_unescape_len (data->cx, p, end - p);
- data->text = g_string_append (data->text, unescaped);
- g_free (unescaped);
-
- if (data->condense_white && g_ascii_isspace (*end)) {
- data->text = g_string_append_c (data->text, ' ');
- p = end + strspn (end, " \n...
2007 Nov 30
0
36 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_date.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_flash_security.c
...-GType swfdec_xml_get_type (void);
+GType swfdec_xml_get_type (void);
-char * swfdec_xml_escape (const char * orginal);
-char * swfdec_xml_escape_len (const char * orginal,
- gssize length);
-char * swfdec_xml_unescape (SwfdecAsContext * cx,
- const char * orginal);
-char * swfdec_xml_unescape_len (SwfdecAsContext * cx,
- const char * orginal,
- gssize length);
+char * swfdec_xml_escape (const char * orginal);
+char * swfdec_xml_escape_len (const char * orginal,
+ gssize length);
+char * swfdec_xml_unescape (SwfdecAsContext * cx,
+ const char * orginal);
+...