pidgin: d6d0af37: Formatting changes, no functionality.
markdoliner at pidgin.im
markdoliner at pidgin.im
Fri Jul 3 05:10:48 EDT 2009
-----------------------------------------------------------------
Revision: d6d0af3753826ea4715b3f4ca3bd41f0d63161b3
Ancestor: 7bd57cddaf2dc03e0a2e8680494ef157bc0d3567
Author: markdoliner at pidgin.im
Date: 2009-07-03T09:05:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d6d0af3753826ea4715b3f4ca3bd41f0d63161b3
Modified files:
libpurple/util.c
ChangeLog:
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);
-------------- next part --------------
============================================================
--- libpurple/util.c 10ff4dd275fe591ee44e41da047659cd7fbe5cf6
+++ libpurple/util.c 908a3adc318a03c75205b97c88cce616b6c81c17
@@ -2399,30 +2399,32 @@ purple_markup_linkify(const char *text)
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;
+char *purple_unescape_html(const char *html)
+{
+ GString *ret;
+ const char *c = html;
- 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++;
- }
+ 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 *
More information about the Commits
mailing list