Mercurial > pidgin
changeset 27268:c0075538109b
Formatting changes, no functionality.
* Return early if html is null (instead of indenting everything one
level)
* No need to set ret=g_string_append(ret, blah);
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 03 Jul 2009 09:05:51 +0000 |
parents | 46e182c1c14f |
children | fd52b7a547e4 |
files | libpurple/util.c |
diffstat | 1 files changed, 23 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/util.c Fri Jul 03 06:03:01 2009 +0000 +++ b/libpurple/util.c Fri Jul 03 09:05:51 2009 +0000 @@ -2399,30 +2399,32 @@ return g_string_free(ret, FALSE); } -char * -purple_unescape_html(const char *html) { - if (html != NULL) { - const char *c = html; - GString *ret = g_string_new(""); - while (*c) { - int len; - const char *ent; - - if ((ent = purple_markup_unescape_entity(c, &len)) != NULL) { - ret = g_string_append(ret, ent); - c += len; - } else if (!strncmp(c, "<br>", 4)) { - ret = g_string_append_c(ret, '\n'); - c += 4; - } else { - ret = g_string_append_c(ret, *c); - c++; - } +char *purple_unescape_html(const char *html) +{ + GString *ret; + const char *c = html; + + if (html == NULL) + return NULL; + + ret = g_string_new(""); + while (*c) { + int len; + const char *ent; + + if ((ent = purple_markup_unescape_entity(c, &len)) != NULL) { + g_string_append(ret, ent); + c += len; + } else if (!strncmp(c, "<br>", 4)) { + g_string_append_c(ret, '\n'); + c += 4; + } else { + g_string_append_c(ret, *c); + c++; } - return g_string_free(ret, FALSE); } - return NULL; + return g_string_free(ret, FALSE); } char *