[gnome-control-center] sharing: Fix crash in media preferences
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sharing: Fix crash in media preferences
- Date: Thu, 24 Jul 2014 10:40:32 +0000 (UTC)
commit 056784e60e22b1e42b5183e53b9e3ea9d6606c3d
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jul 21 19:10:47 2014 +0200
sharing: Fix crash in media preferences
When XDG user dirs are badly setup, g_get_user_special_dir() will return
NULL, causing us to crash. Use g_strcmp0() instead.
https://bugzilla.gnome.org/show_bug.cgi?id=733489
panels/sharing/cc-media-sharing.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/panels/sharing/cc-media-sharing.c b/panels/sharing/cc-media-sharing.c
index 73b2590..0c59b73 100644
--- a/panels/sharing/cc-media-sharing.c
+++ b/panels/sharing/cc-media-sharing.c
@@ -106,19 +106,19 @@ cc_media_sharing_set_preferences (gchar **folders)
while (str_list && *str_list)
{
- if (g_str_equal (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_MUSIC)))
+ if (g_strcmp0 (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_MUSIC)) == 0)
{
g_free (*str_list);
*str_list = g_strdup ("@MUSIC@");
}
- if (g_str_equal (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS)))
+ if (g_strcmp0 (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS)) == 0)
{
g_free (*str_list);
*str_list = g_strdup ("@VIDEOS@");
}
- if (g_str_equal (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_PICTURES)))
+ if (g_strcmp0 (*str_list, g_get_user_special_dir (G_USER_DIRECTORY_PICTURES)) == 0)
{
g_free (*str_list);
*str_list = g_strdup ("@PICTURES@");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]