Mercurial > pidgin.yaz
diff pidgin/gtkconv.c @ 22636:7a68335d1086
merge of '37d6f8af593bffa17bba1823a3c5a8612bcfdf18'
and '6f293106dd16191e1ee2fd0ae94ab626d6753c98'
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sat, 12 Apr 2008 20:20:09 +0000 |
parents | 0c59913dc8a0 |
children | 5624eec4da24 |
line wrap: on
line diff
--- a/pidgin/gtkconv.c Sat Apr 12 19:40:06 2008 +0000 +++ b/pidgin/gtkconv.c Sat Apr 12 20:20:09 2008 +0000 @@ -6538,7 +6538,9 @@ markup = title; } } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { - const char *topic = gtkconv->u.chat->topic_text ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) : NULL; + const char *topic = gtkconv->u.chat->topic_text + ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) + : NULL; char *esc = NULL, *tmp; #if GTK_CHECK_VERSION(2,6,0) esc = topic ? g_markup_escape_text(topic, -1) : NULL; @@ -6548,20 +6550,22 @@ int len = 0; char *c; - tmp = g_strdup(topic); - c = tmp; - while(*c && len < 72) { - c = g_utf8_next_char(c); - len++; + if (topic != NULL) { + tmp = g_strdup(topic); + c = tmp; + while(*c && len < 72) { + c = g_utf8_next_char(c); + len++; + } + if (len == 72) { + *c = '\0'; + c = g_strdup_printf("%s...", tmp); + g_free(tmp); + tmp = c; + } + esc = g_markup_escape_text(tmp, -1); + g_free(tmp); } - if (len == 72) { - *c = '\0'; - c = g_strdup_printf("%s...", tmp); - g_free(tmp); - tmp = c; - } - esc = tmp ? g_markup_escape_text(tmp, -1) : NULL; - g_free(tmp); #endif tmp = g_markup_escape_text(purple_conversation_get_title(conv), -1); markup = g_strdup_printf("%s%s<span color='%s' size='smaller'>%s</span>",