bug-gnu-arch
[Top][All Lists]
Advanced

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

[Bug-gnu-arch] [bug #15286] "tla [ar]browse" on sftp:// has many dupes


From: Lionel Elie Mamane
Subject: [Bug-gnu-arch] [bug #15286] "tla [ar]browse" on sftp:// has many dupes
Date: Sat, 24 Dec 2005 23:57:32 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Galeon/1.3.21 (Debian package 1.3.21-8)

Follow-up Comment #2, bug #15286 (project gnu-arch):

Here's a patch to fix it:

--- orig/libarch/archive-pfs.c
+++ mod/libarch/archive-pfs.c
@@ -309,6 +309,7 @@
     }

   rel_free_table (files);
+  rel_sort_table_by_field (0, answer, 0);
   rel_uniq_by_field (&answer, 0);
   return answer;
 }

The reason for the bug is quite simple: In function pfs_baz_search, the
directory list is created in the list the OS/sftp gives it to us, so not
necessarily sorted. But rel_uniq_by_field supposes that this list is *sorted*
(it removes only consecutives duplicates). So the list has to be explicitly
sorted before being passed to rel_uniq_by_field. (Note that the uniquified
list will be sorted *again* higher up in the call trace, by
arch_archive_categories in archive.c . Maybe that later sort can be removed,
maybe not. I'm not familiar enough with the code.)

This also explains why this didn't happen with http access: the .listing file
is kept in sorted order!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=15286>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]