/srv/mercurial-server/detachablepurple: 127e9eab6572: Fix: check...
Gilles Bedel
gillux at cpw.pidgin.im
Fri Jun 15 22:01:45 EDT 2012
Changeset: 127e9eab6572e2b88f0f6e851e6923ff28fb0679
Author: Gilles Bedel <gillux at cpw.pidgin.im>
Date: 2012-05-20 15:52 +0000
Branch: cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/127e9eab6572
Description:
Fix: check whether a group have a name
before using it in its dbus path name.
diffstat:
libpurple/dbus/group.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (20 lines):
diff --git a/libpurple/dbus/group.c b/libpurple/dbus/group.c
--- a/libpurple/dbus/group.c
+++ b/libpurple/dbus/group.c
@@ -41,9 +41,13 @@
/* 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