/pidgin/main: 20d5c960d48f: Use an escaped basename as the filen...

Mark Doliner mark at kingant.net
Mon Feb 18 23:44:31 EST 2013


Changeset: 20d5c960d48ffff3e22b5d95afc26972df8faa12
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2013-02-18 20:44 -0800
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/20d5c960d48f

Description:

Use an escaped basename as the filename for incoming IM images

diffstat:

 libpurple/protocols/oscar/odc.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (18 lines):

diff --git a/libpurple/protocols/oscar/odc.c b/libpurple/protocols/oscar/odc.c
--- a/libpurple/protocols/oscar/odc.c
+++ b/libpurple/protocols/oscar/odc.c
@@ -356,7 +356,13 @@ peer_odc_handle_payload(PeerConnection *
 
 			if ((embedded_data != NULL) && (embedded_data->size == size))
 			{
-				imgid = purple_imgstore_new_with_id(g_memdup(embedded_data->data, size), size, src);
+				char *basename;
+				char *escaped;
+				basename = g_path_get_basename(src);
+				escaped = g_strdup(purple_escape_filename(basename));
+				g_free(basename);
+				imgid = purple_imgstore_new_with_id(g_memdup(embedded_data->data, size), size, escaped);
+				g_free(escaped);
 
 				/* Record the image number */
 				images = g_slist_append(images, GINT_TO_POINTER(imgid));



More information about the Commits mailing list