summaryrefslogtreecommitdiff
path: root/common/gmountspec.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:33:13 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:33:13 +0000
commit4c07a5d15736b97f35c6b21a11731ac56de55ea7 (patch)
treeed7387f794fe02e40945666630069e5cc7a340c3 /common/gmountspec.c
parent4cb3c1108a042a8c41c76bd7d49264f173fc002b (diff)
downloadgvfs-4c07a5d15736b97f35c6b21a11731ac56de55ea7.tar.gz
Make g_mount_spec_set handle setting an already set key
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1171013571 +0100 svn path=/trunk/; revision=309
Diffstat (limited to 'common/gmountspec.c')
-rw-r--r--common/gmountspec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c
index f77fe597..d0a92a62 100644
--- a/common/gmountspec.c
+++ b/common/gmountspec.c
@@ -51,6 +51,19 @@ g_mount_spec_set (GMountSpec *spec,
const char *key,
const char *value)
{
+ int i;
+
+ for (i = 0; i < spec->items->len; i++)
+ {
+ GMountSpecItem *item = &g_array_index (spec->items, GMountSpecItem, i);
+ if (strcmp (item->key, key) == 0)
+ {
+ g_free (item->value);
+ item->value = g_strdup (value);
+ return;
+ }
+ }
+
add_item (spec, key, g_strdup (value));
g_array_sort (spec->items, item_compare);
}