changeset 26220:9a5da524fba9

Use purple_util_chrreplace instead of g_strsplit then g_strjoinv
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Sun, 20 Jul 2008 17:37:46 +0000
parents 51bdaa82b95d
children 1cf212ba3926
files libpurple/protocols/yahoo/yahoo_filexfer.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c	Sun Jul 20 16:51:19 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c	Sun Jul 20 17:37:46 2008 +0000
@@ -1417,7 +1417,6 @@
 	gchar *filename;
 	const char *local_ip;
 	gchar *url_to_send = NULL;
-	char **split;
 	char *filename_without_spaces = NULL;
 
 	xfer = data;
@@ -1434,8 +1433,8 @@
 		xd->yahoo_local_p2p_ft_server_port = purple_network_get_port_from_fd(listenfd);
 
 		filename = g_path_get_basename(purple_xfer_get_local_filename(xfer));
-		split = g_strsplit(filename, " ", 0);
-		filename_without_spaces = g_strjoinv("+", split);
+		filename_without_spaces = g_strdup(filename);
+		purple_util_chrreplace(filename_without_spaces, ' ', '+');
 		xd->xfer_url = g_strdup_printf("/Messenger.%s.%d000%s?AppID=Messenger&UserID=%s&K=lc9lu2u89gz1llmplwksajkjx", xfer->who, (int)time(NULL), filename_without_spaces, xfer->who);
 		url_to_send = g_strdup_printf("http://%s:%d%s", local_ip, xd->yahoo_local_p2p_ft_server_port, xd->xfer_url);
 
@@ -1467,7 +1466,6 @@
 
 		g_free(filename);
 		g_free(url_to_send);
-		g_strfreev(split);
 		g_free(filename_without_spaces);
 	}