cpw.gillux.detachablepurple: ad827fdc: Fix: check whether a group have a name

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sun May 20 13:21:50 EDT 2012


----------------------------------------------------------------------
Revision: ad827fdcc6c88f90c46858d8b9baf6c5b31f1ebf
Parent:   2898899e908498f21ddbfc829c4e9181e72feec9
Author:   gillux at soc.pidgin.im
Date:     05/20/12 11:52:59
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/ad827fdcc6c88f90c46858d8b9baf6c5b31f1ebf

Changelog: 

Fix: check whether a group have a name
before using it in its dbus path name.

Changes against parent 2898899e908498f21ddbfc829c4e9181e72feec9

  patched  libpurple/dbus/group.c

-------------- next part --------------
============================================================
--- libpurple/dbus/group.c	8e9d13eecf23ad63371390e8250c9b85c4f62b57
+++ libpurple/dbus/group.c	f4ddf3dc838880cf1deed4f0766445bbda4608c5
@@ -41,9 +41,13 @@ purple_group_build_dbus_path(PurpleObjec
 	/* Group names are unique but they can change, whereas dbus path names
 	 * can't. So we use an id, with the group name appended, to make it
 	 * meaningful, since groups are rarely renamed. */
-	name_valid = purple_dbus_sanitize_dbus_path(name);
-	path = g_strdup_printf(DBUS_GROUP_PATH "/%u_%s", group_id++, name_valid);
-	g_free(name_valid);
+	if (name) {
+		name_valid = purple_dbus_sanitize_dbus_path(name);
+		path = g_strdup_printf(DBUS_GROUP_PATH "/%u_%s", group_id++, name_valid);
+		g_free(name_valid);
+	} else {
+		path = g_strdup_printf(DBUS_GROUP_PATH "/%u", group_id++);
+	}
 
 	return path;
 }


More information about the Commits mailing list