diff lib/config_file.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 f946521bb2f2
children d553d14a2565
line wrap: on
line diff
--- a/lib/config_file.c	Tue Nov 02 06:55:01 2004 +0000
+++ b/lib/config_file.c	Wed Nov 03 10:51:32 2004 +0000
@@ -1554,27 +1554,21 @@
   tempentry = bookmarks;
   while (tempentry != NULL)
     {
-      gftp_free_bookmark (tempentry);
-
-      if (tempentry->path != NULL)
-        g_free (tempentry->path);
-
       if (tempentry->children != NULL)
+        tempentry = tempentry->children;
+      else
         {
-          tempentry = tempentry->children;
-          continue;
+          while (tempentry->next == NULL && tempentry->prev != NULL)
+            {
+              delentry = tempentry;
+              tempentry = tempentry->prev;
+              gftp_free_bookmark (delentry, 1);
+            }
+    
+          delentry = tempentry;
+          tempentry = tempentry->next;
+          gftp_free_bookmark (delentry, 1);
         }
-
-      while (tempentry->next == NULL && tempentry->prev != NULL)
-        {
-          delentry = tempentry;
-          tempentry = tempentry->prev;
-          g_free (delentry);
-        }
-
-      delentry = tempentry;
-      tempentry = tempentry->next;
-      g_free (delentry);
     }
 }