diff lib/misc.c @ 609:d97e985f5dbe

2004-11-3 Brian Masney <masneyb@gftp.org> * lib/config_file.c (gftp_bookmarks_destroy) src/gtk/bookmarks.c (bm_apply_changes) - cleaned up the tree parsing code * lib/gftp.h lib/misc.c lib/config_file.c src/gtk/bookmarks.c - added free_node argument to gftp_free_bookmark() * lib/gftp.h src/gtk/bookmarks.c - added oldpath variable to the gftp_bookmarks structure.
author masneyb
date Wed, 03 Nov 2004 10:51:32 +0000
parents fa0838b22b14
children 08e7b5186eb8
line wrap: on
line diff
--- a/lib/misc.c	Tue Nov 02 06:55:01 2004 +0000
+++ b/lib/misc.c	Wed Nov 03 10:51:32 2004 +0000
@@ -988,8 +988,10 @@
 
 
 void
-gftp_free_bookmark (gftp_bookmarks_var * entry)
+gftp_free_bookmark (gftp_bookmarks_var * entry, int free_node)
 {
+  gftp_bookmarks_var * tempentry;
+
   if (entry->hostname)
     g_free (entry->hostname);
   if (entry->remote_dir)
@@ -1015,6 +1017,15 @@
       entry->local_options_hash = NULL;
       entry->num_local_options_vars = 0;
     }
+
+  if (free_node)
+    g_free (entry);
+  else
+    {
+      tempentry = entry->children;
+      memset (entry, 0, sizeof (*entry));
+      entry->children = tempentry;
+    }
 }