comparison plugins/log_reader.c @ 14080:ec4a3eb4c709

[gaim-migrate @ 16701] leak fix committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 11 Aug 2006 03:01:14 +0000
parents 034a3ffa09de
children a82d407d38fa
comparison
equal deleted inserted replaced
14079:25a2b762cd61 14080:ec4a3eb4c709
788 enum name_guesses name_guessed = NAME_GUESS_UNKNOWN; 788 enum name_guesses name_guessed = NAME_GUESS_UNKNOWN;
789 const char *their_name; 789 const char *their_name;
790 time_t time_unix; 790 time_t time_unix;
791 struct tm *tm_new; 791 struct tm *tm_new;
792 char *timestamp; 792 char *timestamp;
793 char *tmp;
793 const char *style; 794 const char *style;
794 795
795 new_session_id = xmlnode_get_attrib(message, "SessionID"); 796 new_session_id = xmlnode_get_attrib(message, "SessionID");
796 797
797 /* If this triggers, something is wrong with the XML. */ 798 /* If this triggers, something is wrong with the XML. */
980 if (name_guessed != NAME_GUESS_UNKNOWN) 981 if (name_guessed != NAME_GUESS_UNKNOWN)
981 text = g_string_append(text, "</span>"); 982 text = g_string_append(text, "</span>");
982 983
983 style = xmlnode_get_attrib(text_node, "Style"); 984 style = xmlnode_get_attrib(text_node, "Style");
984 985
986 tmp = xmlnode_get_data(text_node);
985 if (style && *style) { 987 if (style && *style) {
986 text = g_string_append(text, "<span style=\""); 988 text = g_string_append(text, "<span style=\"");
987 text = g_string_append(text, style); 989 text = g_string_append(text, style);
988 text = g_string_append(text, "\">"); 990 text = g_string_append(text, "\">");
989 text = g_string_append(text, xmlnode_get_data(text_node)); 991 text = g_string_append(text, tmp);
990 text = g_string_append(text, "</span>\n"); 992 text = g_string_append(text, "</span>\n");
991 } else { 993 } else {
992 text = g_string_append(text, xmlnode_get_data(text_node)); 994 text = g_string_append(text, tmp);
993 text = g_string_append(text, "\n"); 995 text = g_string_append(text, "\n");
994 } 996 }
997 g_free(tmp);
995 } 998 }
996 999
997 data->text = text; 1000 data->text = text;
998 1001
999 return text->str; 1002 return text->str;
1460 } else if (gaim_str_has_prefix(line, 1463 } else if (gaim_str_has_prefix(line,
1461 "Your previous message has not been sent.")) { 1464 "Your previous message has not been sent.")) {
1462 1465
1463 g_string_append(formatted, 1466 g_string_append(formatted,
1464 "<span style=\"color: #ff0000;\">"); 1467 "<span style=\"color: #ff0000;\">");
1465 1468
1466 if (gaim_str_has_prefix(line, 1469 if (gaim_str_has_prefix(line,
1467 "Your previous message has not been sent. " 1470 "Your previous message has not been sent. "
1468 "Reason: Maximum length exceeded.")) { 1471 "Reason: Maximum length exceeded.")) {
1469 1472
1470 g_string_append(formatted, 1473 g_string_append(formatted,
1684 DWORD type; 1687 DWORD type;
1685 gboolean found = FALSE; 1688 gboolean found = FALSE;
1686 1689
1687 path = NULL; 1690 path = NULL;
1688 /* TODO: Test this after removing the trailing "\\". */ 1691 /* TODO: Test this after removing the trailing "\\". */
1689 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\", 1692 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\",
1690 0, KEY_QUERY_VALUE, &hKey)) { 1693 0, KEY_QUERY_VALUE, &hKey)) {
1691 1694
1692 if(ERROR_SUCCESS == RegQueryValueEx(hKey, "", NULL, &type, (LPBYTE)buffer, &size)) { 1695 if(ERROR_SUCCESS == RegQueryValueEx(hKey, "", NULL, &type, (LPBYTE)buffer, &size)) {
1693 char *value = buffer; 1696 char *value = buffer;
1694 char *temp; 1697 char *temp;