/pidgin/main: 491716e51b9b: Merge from the release-2.x.y branch....

Mark Doliner mark at kingant.net
Tue Feb 19 01:21:44 EST 2013


Changeset: 491716e51b9b697a693ef3f4846449a9f2ad2216
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2013-02-18 22:21 -0800
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/491716e51b9b

Description:

Merge from the release-2.x.y branch.  Some manual merging in
gtkconv.c and upnp.c, but it was pretty easy.

diffstat:

 Makefile.mingw                            |  2 +-
 libpurple/buddyicon.c                     |  2 +-
 libpurple/certificate.c                   |  4 ++--
 libpurple/log.c                           |  2 +-
 libpurple/plugin.c                        |  7 ++-----
 libpurple/protocols/jabber/bosh.c         |  6 ++----
 libpurple/protocols/jabber/useravatar.c   |  8 ++++++--
 libpurple/protocols/msn/msn.c             |  2 +-
 libpurple/protocols/oscar/family_icbm.c   |  2 +-
 libpurple/protocols/oscar/oscar.c         |  2 +-
 libpurple/protocols/silc/wb.c             |  2 +-
 libpurple/protocols/yahoo/yahoo_profile.c |  2 +-
 libpurple/theme-loader.c                  |  1 +
 libpurple/upnp.c                          |  2 --
 libpurple/win32/global.mak                |  2 +-
 pidgin/gtkconv.c                          |  2 +-
 pidgin/gtkimhtml.c                        |  7 ++++---
 17 files changed, 27 insertions(+), 28 deletions(-)

diffs (242 lines):

diff --git a/Makefile.mingw b/Makefile.mingw
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -109,7 +109,7 @@ endif
 	cp $(ENCHANT_TOP)/bin/libenchant.dll $(PIDGIN_INSTALL_DIR)/spellcheck
 	cp -R $(ENCHANT_TOP)/lib/enchant/*.dll $(PIDGIN_INSTALL_DIR)/spellcheck/lib/enchant
 	cp $(PIDGIN_INST_DEP_DIR)/exchndl.dll $(PIDGIN_INSTALL_DIR)
-	cp $(GCC_SSP_TOP)/bin/libssp-0.dll $(PIDGIN_INSTALL_DIR)
+	cp $(GCC_SSP_TOP)/libssp-0.dll $(PIDGIN_INSTALL_DIR)
 
 gtk_runtime_zip:
 	pidgin/win32/nsis/generate_gtk_zip.sh "`pwd`" "$(GPG_SIGN)"
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -390,7 +390,7 @@ purple_buddy_icon_update(PurpleBuddyIcon
 	icon_to_set = icon->img ? icon : NULL;
 
 	/* Ensure that icon remains valid throughout */
-	if (icon) purple_buddy_icon_ref(icon);
+	purple_buddy_icon_ref(icon);
 
 	buddies = purple_find_buddies(account, username);
 	while (buddies != NULL)
diff --git a/libpurple/certificate.c b/libpurple/certificate.c
--- a/libpurple/certificate.c
+++ b/libpurple/certificate.c
@@ -504,8 +504,8 @@ purple_certificate_pool_mkpath(PurpleCer
 	g_return_val_if_fail(pool->name, NULL);
 
 	/* Escape all the elements for filesystem-friendliness */
-	esc_scheme_name = pool ? g_strdup(purple_escape_filename(pool->scheme_name)) : NULL;
-	esc_name = pool ? g_strdup(purple_escape_filename(pool->name)) : NULL;
+	esc_scheme_name = g_strdup(purple_escape_filename(pool->scheme_name));
+	esc_name = g_strdup(purple_escape_filename(pool->name));
 	esc_id = id ? g_strdup(purple_escape_filename(id)) : NULL;
 
 	path = g_build_filename(purple_user_dir(),
diff --git a/libpurple/log.c b/libpurple/log.c
--- a/libpurple/log.c
+++ b/libpurple/log.c
@@ -1149,7 +1149,7 @@ static void log_get_log_sets_common(GHas
 				}
 
 				/* Determine if this (account, name) combination exists as a buddy. */
-				if (account != NULL && name != NULL && *name != '\0')
+				if (account != NULL && *name != '\0')
 					set->buddy = (purple_find_buddy(account, name) != NULL);
 				else
 					set->buddy = FALSE;
diff --git a/libpurple/plugin.c b/libpurple/plugin.c
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -580,11 +580,8 @@ purple_plugin_load(PurplePlugin *plugin)
 
 	if (plugin->native_plugin)
 	{
-		if (plugin->info != NULL && plugin->info->load != NULL)
-		{
-			if (!plugin->info->load(plugin))
-				return FALSE;
-		}
+		if (plugin->info->load != NULL && !plugin->info->load(plugin))
+			return FALSE;
 	}
 	else {
 		PurplePlugin *loader;
diff --git a/libpurple/protocols/jabber/bosh.c b/libpurple/protocols/jabber/bosh.c
--- a/libpurple/protocols/jabber/bosh.c
+++ b/libpurple/protocols/jabber/bosh.c
@@ -348,10 +348,8 @@ jabber_bosh_connection_send(PurpleBOSHCo
 		 * sent immediately), queue up the data and start a timer to flush
 		 * the buffer.
 		 */
-		if (data) {
-			int len = data ? strlen(data) : 0;
-			purple_circ_buffer_append(conn->pending, data, len);
-		}
+		if (data)
+			purple_circ_buffer_append(conn->pending, data, strlen(data));
 
 		if (purple_debug_is_verbose())
 			purple_debug_misc("jabber", "bosh: %p has %" G_GSIZE_FORMAT " bytes in "
diff --git a/libpurple/protocols/jabber/useravatar.c b/libpurple/protocols/jabber/useravatar.c
--- a/libpurple/protocols/jabber/useravatar.c
+++ b/libpurple/protocols/jabber/useravatar.c
@@ -114,6 +114,7 @@ void jabber_avatar_set(JabberStream *js,
 		 *       and width.
 		 */
 		/* A PNG header, including the IHDR, but nothing else */
+		/* ATTN: this is in network byte order! */
 		const struct {
 			guchar signature[8]; /* must be hex 89 50 4E 47 0D 0A 1A 0A */
 			struct {
@@ -127,10 +128,13 @@ void jabber_avatar_set(JabberStream *js,
 				guchar filter;
 				guchar interlace;
 			} ihdr;
-		} *png = purple_imgstore_get_data(img); /* ATTN: this is in network byte order! */
+		} *png = NULL;
+
+		if (purple_imgstore_get_size(img) > sizeof(*png))
+			png = purple_imgstore_get_data(img);
 
 		/* check if the data is a valid png file (well, at least to some extent) */
-		if(png->signature[0] == 0x89 &&
+		if(png && png->signature[0] == 0x89 &&
 		   png->signature[1] == 0x50 &&
 		   png->signature[2] == 0x4e &&
 		   png->signature[3] == 0x47 &&
diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c
+++ b/libpurple/protocols/msn/msn.c
@@ -2769,7 +2769,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
 	}
 
 	/* Try to put the photo in there too, if there's one and is readable */
-	if (user_data && url_text && len != 0)
+	if (url_text && len != 0)
 	{
 		if (strstr(url_text, "400 Bad Request")
 			|| strstr(url_text, "403 Forbidden")
diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c
--- a/libpurple/protocols/oscar/family_icbm.c
+++ b/libpurple/protocols/oscar/family_icbm.c
@@ -156,7 +156,7 @@ error(OscarData *od, FlapConnection *con
 
 	purple_debug_error("oscar",
 			   "Message error with bn %s and reason %hu and errcode %hu\n",
-				(bn != NULL ? bn : ""), reason, errcode);
+				bn, reason, errcode);
 
 #ifdef TODOFT
 	/* If this was a file transfer request, bn is a cookie */
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -4138,7 +4138,7 @@ static int purple_ssi_parseack(OscarData
 				if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf))
 					purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 				g_free(buf);
-			}
+			} break;
 
 			case 0x000e: { /* buddy requires authorization */
 				if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name))
diff --git a/libpurple/protocols/silc/wb.c b/libpurple/protocols/silc/wb.c
--- a/libpurple/protocols/silc/wb.c
+++ b/libpurple/protocols/silc/wb.c
@@ -191,7 +191,7 @@ silcpurple_wb_parse(PurpleWhiteboard *wb
 
 	/* Update whiteboard if its dimensions changed */
 	if (width != wbs->width || height != wbs->height)
-		silcpurple_wb_set_dimensions(wb, height, width);
+		silcpurple_wb_set_dimensions(wb, width, height);
 
 	if (command == SILCPURPLE_WB_DRAW) {
 		/* Parse data and draw it */
diff --git a/libpurple/protocols/yahoo/yahoo_profile.c b/libpurple/protocols/yahoo/yahoo_profile.c
--- a/libpurple/protocols/yahoo/yahoo_profile.c
+++ b/libpurple/protocols/yahoo/yahoo_profile.c
@@ -1036,7 +1036,7 @@ yahoo_got_photo(PurpleUtilFetchUrlData *
 
 #if PHOTO_SUPPORT
 	/* Try to put the photo in there too, if there's one and is readable */
-	if (data && url_text && len != 0) {
+	if (url_text && len != 0) {
 		if (strstr(url_text, "400 Bad Request")
 				|| strstr(url_text, "403 Forbidden")
 				|| strstr(url_text, "404 Not Found")) {
diff --git a/libpurple/theme-loader.c b/libpurple/theme-loader.c
--- a/libpurple/theme-loader.c
+++ b/libpurple/theme-loader.c
@@ -63,6 +63,7 @@ purple_theme_loader_get_property(GObject
 	switch (param_id) {
 		case PROP_TYPE:
 			g_value_set_string(value, purple_theme_loader_get_type_string(theme_loader));
+			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
 			break;
diff --git a/libpurple/upnp.c b/libpurple/upnp.c
--- a/libpurple/upnp.c
+++ b/libpurple/upnp.c
@@ -747,7 +747,6 @@ const gchar *
 purple_upnp_get_public_ip()
 {
 	if (control_info.status == PURPLE_UPNP_STATUS_DISCOVERED
-			&& control_info.publicip
 			&& *control_info.publicip)
 		return control_info.publicip;
 
@@ -806,7 +805,6 @@ static const gchar *
 purple_upnp_get_internal_ip(void)
 {
 	if (control_info.status == PURPLE_UPNP_STATUS_DISCOVERED
-			&& control_info.internalip
 			&& *control_info.internalip)
 		return control_info.internalip;
 
diff --git a/libpurple/win32/global.mak b/libpurple/win32/global.mak
--- a/libpurple/win32/global.mak
+++ b/libpurple/win32/global.mak
@@ -22,7 +22,7 @@ PERL_LIB_TOP ?= $(WIN32_DEV_TOP)/perl-5.
 SILC_TOOLKIT ?= $(WIN32_DEV_TOP)/silc-toolkit-1.1.10
 TCL_LIB_TOP ?= $(WIN32_DEV_TOP)/tcl-8.4.5
 GSTREAMER_TOP ?= $(WIN32_DEV_TOP)/gstreamer-0.10.13
-GCC_SSP_TOP ?= $(WIN32_DEV_TOP)/gcc-core-4.4.0-mingw32-dll
+GCC_SSP_TOP ?= $(shell dirname $(shell which $(CC)))
 CYRUS_SASL_TOP ?= $(WIN32_DEV_TOP)/cyrus-sasl-2.1.25
 
 # Where we installing this stuff to?
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -7194,7 +7194,7 @@ gray_stuff_out(PidginConversation *gtkco
 			gtk_action_set_visible(win->menu.unblock, TRUE);
 		}
 
-		if ((account == NULL) || purple_find_buddy(account, purple_conversation_get_name(conv)) == NULL) {
+		if (purple_find_buddy(account, purple_conversation_get_name(conv)) == NULL) {
 			gtk_action_set_visible(win->menu.add, TRUE);
 			gtk_action_set_visible(win->menu.remove, FALSE);
 		} else {
diff --git a/pidgin/gtkimhtml.c b/pidgin/gtkimhtml.c
--- a/pidgin/gtkimhtml.c
+++ b/pidgin/gtkimhtml.c
@@ -2430,10 +2430,11 @@ gtk_imhtml_is_tag (const gchar *string,
 	if (!g_ascii_strncasecmp(string, "!--", strlen ("!--"))) {
 		gchar *e = strstr (string + strlen("!--"), "-->");
 		if (e) {
-			if (len)
+			if (len) {
 				*len = e - string + strlen ("-->");
-			if (tag)
-				*tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->"));
+				if (tag)
+					*tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->"));
+			}
 			return TRUE;
 		}
 	}



More information about the Commits mailing list