diff src/gtk/bookmarks.c @ 772:9a6477042520

2006-7-19 Brian Masney <masneyb@gftp.org> * src/gtk/bookmarks.c - fixed segfault in the bookmarks editor (from Grant Hammond <grant@f1fox.net>) (closes #329261 and #169617)
author masneyb
date Thu, 20 Jul 2006 01:54:39 +0000
parents 49cfbe02926b
children 96ce71cd7bf5
line wrap: on
line diff
--- a/src/gtk/bookmarks.c	Thu Jul 20 01:46:43 2006 +0000
+++ b/src/gtk/bookmarks.c	Thu Jul 20 01:54:39 2006 +0000
@@ -683,7 +683,6 @@
   oldpathlen = strlen (entry->path);
   if ((pos = strrchr (entry->path, '/')) != NULL)
     {
-      pos = entry->path;
       tempchar = *pos;
       *pos = '\0';
       newpath = gftp_build_path (NULL, entry->path, tempstr, NULL);
@@ -750,10 +749,14 @@
 
       while (tempentry != NULL)
 	{
-	  g_hash_table_remove (new_bookmarks_htable, tempentry->path);
-
           bmentry = g_hash_table_lookup (gftp_bookmarks_htable,
                                          tempentry->path);
+	  if (bmentry == NULL)
+            bmentry = g_hash_table_lookup (new_bookmarks_htable,
+                                           tempentry->path);
+
+          g_hash_table_remove (new_bookmarks_htable, tempentry->path);
+
           if (bmentry->oldpath == NULL)
             bmentry->oldpath = tempentry->path;
           else