changeset 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 d966cf89a820
children 942dd9c2a064
files ChangeLog src/gtk/bookmarks.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 20 01:46:43 2006 +0000
+++ b/ChangeLog	Thu Jul 20 01:54:39 2006 +0000
@@ -1,4 +1,7 @@
 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)
+
 	* src/gtk/gftp-gtk.c - added patch that makes the menus closer to other
 	GNOME apps (from Alan Horkan <horkana@maths.tcd.ie>) (closes #329826)
 
@@ -3425,7 +3428,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.443 2006/07/20 01:46:42 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.444 2006/07/20 01:54:39 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- 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