comparison libpurple/protocols/yahoo/yahoo.c @ 27220:2967cea30d8b

merge of '796290d1402d75f50e27f51683443b86707c9c26' and '8740eeac007708126ac1672fb005bea399aa7f33'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 22 Jun 2009 00:47:25 +0000
parents 01f1929d0936 37ace0f4d63c
children 76dda72a443b 8b17877d3294
comparison
equal deleted inserted replaced
27219:01f1929d0936 27220:2967cea30d8b
1654 g_free(auth_data); 1654 g_free(auth_data);
1655 return; 1655 return;
1656 } 1656 }
1657 else if (len > 0 && ret_data && *ret_data) { 1657 else if (len > 0 && ret_data && *ret_data) {
1658 gchar **split_data = g_strsplit(ret_data, "\r\n", -1); 1658 gchar **split_data = g_strsplit(ret_data, "\r\n", -1);
1659 int totalelements = g_strv_length(split_data); 1659 int totalelements = 0;
1660 int response_no = -1; 1660 int response_no = -1;
1661 char *crumb = NULL; 1661 char *crumb = NULL;
1662 char *crypt = NULL; 1662 char *crypt = NULL;
1663 1663
1664 #if GLIB_CHECK_VERSION(2,6,0)
1665 totalelements = g_strv_length(split_data);
1666 #else
1667 while (split_data[++totalelements] != NULL);
1668 #endif
1664 if (totalelements >= 5) { 1669 if (totalelements >= 5) {
1665 response_no = strtol(split_data[1], NULL, 10); 1670 response_no = strtol(split_data[1], NULL, 10);
1666 crumb = g_strdup(split_data[2] + strlen("crumb=")); 1671 crumb = g_strdup(split_data[2] + strlen("crumb="));
1667 yd->cookie_y = g_strdup(split_data[3] + strlen("Y=")); 1672 yd->cookie_y = g_strdup(split_data[3] + strlen("Y="));
1668 yd->cookie_t = g_strdup(split_data[4] + strlen("T=")); 1673 yd->cookie_t = g_strdup(split_data[4] + strlen("T="));
1736 g_free(auth_data); 1741 g_free(auth_data);
1737 return; 1742 return;
1738 } 1743 }
1739 else if (len > 0 && ret_data && *ret_data) { 1744 else if (len > 0 && ret_data && *ret_data) {
1740 gchar **split_data = g_strsplit(ret_data, "\r\n", -1); 1745 gchar **split_data = g_strsplit(ret_data, "\r\n", -1);
1741 int totalelements = g_strv_length(split_data); 1746 int totalelements = 0;
1742 int response_no = -1; 1747 int response_no = -1;
1743 char *token = NULL; 1748 char *token = NULL;
1744 1749
1750 #if GLIB_CHECK_VERSION(2,6,0)
1751 totalelements = g_strv_length(split_data);
1752 #else
1753 while (split_data[++totalelements] != NULL);
1754 #endif
1745 if(totalelements >= 5) { 1755 if(totalelements >= 5) {
1746 response_no = strtol(split_data[1], NULL, 10); 1756 response_no = strtol(split_data[1], NULL, 10);
1747 token = g_strdup(split_data[2] + strlen("ymsgr=")); 1757 token = g_strdup(split_data[2] + strlen("ymsgr="));
1748 } 1758 }
1749 1759