Mercurial > pidgin
comparison libpurple/xmlnode.c @ 29392:f549ad844d54
propagate from branch 'im.pidgin.pidgin.next.minor' (head 42544ec892337510146c931806a95dbf69c2fe30)
to branch 'im.pidgin.pidgin' (head 32a27a2c6eebcccdecd7d7cd420b3789c69cbb09)
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 18 Feb 2010 09:22:01 +0000 |
parents | 05d727f76ca9 |
children | 77cd42f08ba1 |
comparison
equal
deleted
inserted
replaced
29391:4c266d9c17eb | 29392:f549ad844d54 |
---|---|
541 | 541 |
542 if (len) | 542 if (len) |
543 *len += sizeof("<?xml version='1.0' encoding='UTF-8' ?>" NEWLINE_S NEWLINE_S) - 1; | 543 *len += sizeof("<?xml version='1.0' encoding='UTF-8' ?>" NEWLINE_S NEWLINE_S) - 1; |
544 | 544 |
545 return xml_with_declaration; | 545 return xml_with_declaration; |
546 } | |
547 | |
548 static char *purple_unescape_text(const char *in) | |
549 { | |
550 GString *ret; | |
551 const char *c = in; | |
552 | |
553 if (in == NULL) | |
554 return NULL; | |
555 | |
556 ret = g_string_new(""); | |
557 while (*c) { | |
558 int len; | |
559 const char *ent; | |
560 | |
561 if ((ent = purple_markup_unescape_entity(c, &len)) != NULL) { | |
562 g_string_append(ret, ent); | |
563 c += len; | |
564 } else { | |
565 g_string_append_c(ret, *c); | |
566 c++; | |
567 } | |
568 } | |
569 | |
570 return g_string_free(ret, FALSE); | |
571 } | 546 } |
572 | 547 |
573 struct _xmlnode_parser_data { | 548 struct _xmlnode_parser_data { |
574 xmlnode *current; | 549 xmlnode *current; |
575 gboolean error; | 550 gboolean error; |