summaryrefslogtreecommitdiff
path: root/archiver
diff options
context:
space:
mode:
authorBradford Hovinen <hovinen@ximian.com>2001-07-17 19:08:55 +0000
committerBradford Hovinen (Gdict maintainer) <hovinen@src.gnome.org>2001-07-17 19:08:55 +0000
commit31a81628c4d7313782893ceee01bc3c77bfbaa84 (patch)
tree52f7d57b02ce0a8a80cf625d8940da5506cda457 /archiver
parent313127a2e59f3e952fec4be5af8b1fb71157e5f3 (diff)
downloadgnome-control-center-31a81628c4d7313782893ceee01bc3c77bfbaa84.tar.gz
strdup the string to remove compiler warnings
2001-07-17 Bradford Hovinen <hovinen@ximian.com> * archive.c (archive_unregister_location): (archive_get_location): strdup the string to remove compiler warnings
Diffstat (limited to 'archiver')
-rw-r--r--archiver/ChangeLog3
-rw-r--r--archiver/archive.c18
2 files changed, 15 insertions, 6 deletions
diff --git a/archiver/ChangeLog b/archiver/ChangeLog
index 655cd23ab..f661c7891 100644
--- a/archiver/ChangeLog
+++ b/archiver/ChangeLog
@@ -1,5 +1,8 @@
2001-07-17 Bradford Hovinen <hovinen@ximian.com>
+ * archive.c (archive_unregister_location):
+ (archive_get_location): strdup the string to remove compiler warnings
+
* location.c (location_store): Use return value
(location_store_full_snapshot): Use return value
diff --git a/archiver/archive.c b/archiver/archive.c
index 816ac856f..3a936d750 100644
--- a/archiver/archive.c
+++ b/archiver/archive.c
@@ -337,12 +337,16 @@ Location *
archive_get_location (Archive *archive, const gchar *locid)
{
GtkObject *loc_obj;
+ gchar *tmp;
g_return_val_if_fail (archive != NULL, NULL);
g_return_val_if_fail (IS_ARCHIVE (archive), NULL);
g_return_val_if_fail (locid != NULL, NULL);
- loc_obj = g_tree_lookup (archive->locations, locid);
+ /* Stupid borken glib... */
+ tmp = g_strdup (locid);
+ loc_obj = g_tree_lookup (archive->locations, tmp);
+ g_free (tmp);
if (!loc_obj) {
loc_obj = location_open (archive, locid);
@@ -394,14 +398,18 @@ archive_register_location (Archive *archive, Location *location)
void
archive_unregister_location (Archive *archive, Location *location)
{
+ gchar *tmp;
+
g_return_if_fail (archive != NULL);
g_return_if_fail (IS_ARCHIVE (archive));
g_return_if_fail (location != NULL);
g_return_if_fail (IS_LOCATION (location));
if (GTK_OBJECT_DESTROYED (archive)) return;
-
- g_tree_remove (archive->locations, location_get_id (location));
+
+ tmp = g_strdup (location_get_id (location));
+ g_tree_remove (archive->locations, tmp);
+ g_free (tmp);
}
/**
@@ -417,13 +425,11 @@ archive_unregister_location (Archive *archive, Location *location)
Location *
archive_get_current_location (Archive *archive)
{
- gchar *locid;
+ const gchar *locid = archive_get_current_location_id (archive);
g_return_val_if_fail (archive != NULL, NULL);
g_return_val_if_fail (IS_ARCHIVE (archive), NULL);
- locid = archive_get_current_location_id (archive);
-
if (locid == NULL)
return NULL;
else