summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2012-06-08 18:21:03 +0200
committerTomas Bzatek <tbzatek@redhat.com>2012-07-31 11:59:36 +0200
commitec8f2fca20d36d51d8282281e9f701f855602f14 (patch)
treed511cee99f43dcb312d393aff16d926019007710 /common
parent54071afd025beb577e67d5ac1f662a5715a76903 (diff)
gdbus: Treat empty non-NULL strings for the "ay" type as NULL
A fallout of port away from convenient G_DBUS_TYPE_CSTRING type and _g_dbus_message_append_args() + _g_dbus_message_iter_get_args() functions that masked NULL strings as non-NULL empty strings ("") for transferring over d-bus and on the other side reconstructed the original value. Portions of other code treat non-NULL strings differently even if they were empty. This fixes e.g. opening http URLs via gvfs-open.
Diffstat (limited to 'common')
-rw-r--r--common/gmountspec.c4
-rw-r--r--common/gmounttracker.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c
index 968032ca..e8a6cce3 100644
--- a/common/gmountspec.c
+++ b/common/gmountspec.c
@@ -240,7 +240,9 @@ g_mount_spec_from_dbus (GVariant *iter)
spec = g_mount_spec_new (NULL);
g_free (spec->mount_prefix);
- spec->mount_prefix = g_strdup (mount_prefix);
+ spec->mount_prefix = NULL;
+ if (mount_prefix && mount_prefix[0])
+ spec->mount_prefix = g_strdup (mount_prefix);
while (g_variant_iter_loop (iter_mount_spec_items, "{&sv}", &key, &value))
{
diff --git a/common/gmounttracker.c b/common/gmounttracker.c
index a3909884..19792e2b 100644
--- a/common/gmounttracker.c
+++ b/common/gmounttracker.c
@@ -208,6 +208,11 @@ g_mount_info_from_dbus (GVariant *iter)
if (mount_spec == NULL)
return NULL;
+ if (fuse_mountpoint && fuse_mountpoint[0] == '\0')
+ fuse_mountpoint = NULL;
+ if (default_location && default_location[0] == '\0')
+ default_location = NULL;
+
if (icon_str == NULL || strlen (icon_str) == 0)
icon_str = "drive-removable-media";
error = NULL;