[Xfce4-commits] r23392 - xarchiver/branches/xarchiver-psybsd/libxarchiver

Stephan Arts stephan at xfce.org
Fri Oct 13 08:42:39 UTC 2006


Author: stephan
Date: 2006-10-13 08:42:39 +0000 (Fri, 13 Oct 2006)
New Revision: 23392

Modified:
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
Log:
Fixed potential bug


Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c	2006-10-13 08:37:26 UTC (rev 23391)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c	2006-10-13 08:42:39 UTC (rev 23392)
@@ -68,6 +68,7 @@
 	support->add = NULL;
 	support->extract = NULL;
 	support->remove = NULL;
+	support->refresh = NULL;
 }
 
 /*

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-13 08:37:26 UTC (rev 23391)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-13 08:42:39 UTC (rev 23392)
@@ -279,51 +279,6 @@
 		lxa_archive_entry_flush_buffer(archive, parent);
 }
 
-/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME*/
-/* these functions should not even exist    */
-LXAEntry *
-lxa_entry_get_child(LXAEntry *entry, const gchar *filename)
-{
-	LXASList *buffer_iter = NULL;
-	/* the first element of the array (*entry->children) contains the size of the array */
-	guint size = entry->children?GPOINTER_TO_INT(*entry->children):0;
-	guint pos = 0;
-	guint begin = 1;
-	gint cmp = 0;
-	/* binary search algoritme */
-	while(size)
-	{
-		pos = (size / 2);
-
-		cmp = strcmp(filename, entry->children[begin+pos]->filename);
-		if(!cmp)
-			return entry->children[begin+pos];
-
-		if(cmp < 0)
-		{
-			size = pos;
-		}
-		else
-		{
-			size -= ++pos;
-			begin += pos;
-		}
-	}
-
-	/* search the buffer */
-	for(buffer_iter = entry->buffer; buffer_iter; buffer_iter = buffer_iter->next)
-	{
-		cmp = strcmp(filename, buffer_iter->entry->filename);
-
-		if(!cmp)
-			return buffer_iter->entry;
-		if(cmp < 0)
-			break;
-	}
-
-	return NULL;
-}
-
 void
 lxa_archive_entry_flush_buffer(LXAArchive *archive, LXAEntry *entry)
 {
@@ -402,7 +357,53 @@
 	return entry->children?GPOINTER_TO_INT(*entry->children):0 + lxa_slist_length(entry->buffer);
 }
 
+/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME*/
+/* these functions should not even exist do they?  */
 LXAEntry *
+lxa_entry_get_child(LXAEntry *entry, const gchar *filename)
+{
+	LXASList *buffer_iter = NULL;
+	/* the first element of the array (*entry->children) contains the size of the array */
+	guint size = entry->children?GPOINTER_TO_INT(*entry->children):0;
+	guint pos = 0;
+	guint begin = 1;
+	gint cmp = 0;
+	/* binary search algoritme */
+	while(size)
+	{
+		pos = (size / 2);
+
+		cmp = strcmp(filename, entry->children[begin+pos]->filename);
+		if(!cmp)
+			return entry->children[begin+pos];
+
+		if(cmp < 0)
+		{
+			size = pos;
+		}
+		else
+		{
+			size -= ++pos;
+			begin += pos;
+		}
+	}
+
+	/* search the buffer */
+	for(buffer_iter = entry->buffer; buffer_iter; buffer_iter = buffer_iter->next)
+	{
+		cmp = strcmp(filename, buffer_iter->entry->filename);
+
+		if(!cmp)
+			return buffer_iter->entry;
+		if(cmp < 0)
+			break;
+	}
+
+	return NULL;
+}
+
+
+LXAEntry *
 lxa_entry_children_nth_data(LXAArchive *archive, LXAEntry *entry, guint n)
 {
 	if(entry == NULL)



More information about the Xfce4-commits mailing list