Re: [Patch] Fix for Bug #121152



Soeren Sandmann <sandmann daimi au dk> writes:

> My network connection is bad at the moment, so I can't check out
> nautilus and provide a proper patch, but here is new version of
> g_sequence_node_remove() that I think should work. It passed the test
> I have in my copy of GSequence.

Sorry, that wasn't right either. Here is a new attempt very similar to
Martin's fix except that it also fixes the right->left clobbering
bug. As a diff this time:

Index: gsequence.c
===================================================================
RCS file: /cvs/gnome/nautilus/cut-n-paste-code/gsequence/gsequence.c,v
retrieving revision 1.1
diff -u -r1.1 gsequence.c
--- gsequence.c	27 Jun 2003 16:21:34 -0000	1.1
+++ gsequence.c	15 Sep 2003 13:39:50 -0000
@@ -911,15 +911,21 @@
 
     if (right)
     {
-	right->parent = node->parent;
+	right->parent = NULL;
+	
+	right = g_sequence_node_find_first (right);
+	g_assert (right->left == NULL);
+	
 	right->left = left;
 	if (left)
+	{
 	    left->parent = right;
+	    g_sequence_node_update_fields (right);
+	}
     }
     else if (left)
-	left->parent = node->parent;
+	left->parent = NULL;
 }
-
 
 #if 0
 /* debug func */



Søren



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]