summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2017-08-21 14:22:24 +0200
committerOndrej Holy <oholy@redhat.com>2017-08-21 14:50:44 +0200
commit8cc160ec87f80bb2740959b98bf78b821970e27d (patch)
tree66f3482520807c46b81be04bec0c530b086172fe /client
parentfbce9f8db631d6f0d95700f82b433e9f549090db (diff)
downloadgvfs-8cc160ec87f80bb2740959b98bf78b821970e27d.tar.gz
gdaemonfile: Fix g_file_equal for different mount_prefix
g_daemon_file_equal() always return FALSE for files with different mount_prefix even though the files can be equal. It happen when comparing two files from different origins, e.g. g_mount_get_root() and g_file_new_for_uri(). Let's do the same which is done in _prefix_matches and _get_relative_path in order to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=786217
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonfile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index d51c4c00..485698b2 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -289,8 +289,12 @@ g_daemon_file_equal (GFile *file1,
GDaemonFile *daemon_file1 = G_DAEMON_FILE (file1);
GDaemonFile *daemon_file2 = G_DAEMON_FILE (file2);
- return daemon_file1->mount_spec == daemon_file2->mount_spec &&
- g_str_equal (daemon_file1->path, daemon_file2->path);
+ /* See comment in g_daemon_file_prefix_matches */
+ return (daemon_file1->mount_spec == daemon_file2->mount_spec ||
+ g_mount_spec_match_with_path (daemon_file1->mount_spec,
+ daemon_file2->mount_spec,
+ daemon_file2->path)) &&
+ g_str_equal (daemon_file1->path, daemon_file2->path);
}