summaryrefslogtreecommitdiff
path: root/common/gmountspec.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-01-18 11:24:58 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-01-18 11:24:58 +0000
commitb2f6c97d1cf723946b4d7a24d56ffbfb920d1d7c (patch)
treeaa45f4e9a449b5ddeb29c405c1d88dc2a3cda8b9 /common/gmountspec.c
parent3d50608938aacd9e3a0c9e38349f7437d1533340 (diff)
downloadgvfs-b2f6c97d1cf723946b4d7a24d56ffbfb920d1d7c.tar.gz
Ensure that mount_prefix is never NULL. It should be "/" in that case.
2008-01-18 Alexander Larsson <alexl@redhat.com> * common/gmountspec.c: (g_mount_spec_new_from_data): Ensure that mount_prefix is never NULL. It should be "/" in that case. svn path=/trunk/; revision=1151
Diffstat (limited to 'common/gmountspec.c')
-rw-r--r--common/gmountspec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c
index 179e2a5a..64640d35 100644
--- a/common/gmountspec.c
+++ b/common/gmountspec.c
@@ -58,6 +58,7 @@ g_mount_spec_new (const char *type)
return spec;
}
+/* Takes ownership of passed in data */
GMountSpec *
g_mount_spec_new_from_data (GArray *items,
char *mount_prefix)
@@ -67,7 +68,10 @@ g_mount_spec_new_from_data (GArray *items,
spec = g_new0 (GMountSpec, 1);
spec->ref_count = 1;
spec->items = items;
- spec->mount_prefix = mount_prefix;
+ if (mount_prefix == NULL)
+ spec->mount_prefix = g_strdup ("/");
+ else
+ spec->mount_prefix = mount_prefix;
g_array_sort (spec->items, item_compare);