From a70e9fbdf34768985925b2b81661190a094e718b Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Wed, 31 Aug 2022 15:20:20 +0200 Subject: Fix string comparison In several places, the code compares to strings by comparing their pointers instead of using g_strcmp0(). Although this seems to work, it is incorrect. This MR fixes it. --- daemon/main.c | 2 +- daemon/mount.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'daemon') diff --git a/daemon/main.c b/daemon/main.c index ff1c522b..a36c96b4 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -79,7 +79,7 @@ on_name_acquired (GDBusConnection *connection, char *argv2[6]; /* Use the old .gvfs location as fallback, not .cache/gvfs */ - if (g_get_user_runtime_dir() == g_get_user_cache_dir ()) + if (g_strcmp0 (g_get_user_runtime_dir(), g_get_user_cache_dir ()) == 0) fuse_path = g_build_filename (g_get_home_dir(), ".gvfs", NULL); else fuse_path = g_build_filename (g_get_user_runtime_dir (), "gvfs", NULL); diff --git a/daemon/mount.c b/daemon/mount.c index 41a4b0b7..df9c7afa 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -739,7 +739,7 @@ handle_register_mount (GVfsDBusMountTracker *object, if (arg_user_visible) { /* Use the old .gvfs location as fallback, not .cache/gvfs */ - if (g_get_user_runtime_dir() == g_get_user_cache_dir ()) + if (g_strcmp0 (g_get_user_runtime_dir(), g_get_user_cache_dir ()) == 0) mount->fuse_mountpoint = g_build_filename (g_get_home_dir(), ".gvfs", mount->stable_name, NULL); else mount->fuse_mountpoint = g_build_filename (g_get_user_runtime_dir(), "gvfs", mount->stable_name, NULL); -- cgit v1.2.1