[vlc-commits] commit: directory: collate file names from the same directory ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Mon Nov 15 21:26:27 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 15 22:24:03 2010 +0200| [e4ea738909bdacad129723015449ba6344b315bd] | committer: Rémi Denis-Courmont 

directory: collate file names from the same directory

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e4ea738909bdacad129723015449ba6344b315bd
---

 modules/access/directory.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index 9beafe3..4e43924 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -96,6 +96,11 @@ static int visible (const char *name)
     return name[0] != '.';
 }
 
+static int collate (const char **a, const char **b)
+{
+    return strcoll (*a, *b);
+}
+
 /*****************************************************************************
  * Open: open the directory
  *****************************************************************************/
@@ -140,7 +145,7 @@ int DirInit (access_t *p_access, DIR *handle)
     root->parent = NULL;
     root->handle = handle;
     root->uri = uri;
-    root->filec = vlc_loaddir (handle, &root->filev, visible, NULL);
+    root->filec = vlc_loaddir (handle, &root->filev, visible, collate);
     if (root->filec < 0)
         root->filev = NULL;
     root->i = 0;
@@ -346,7 +351,7 @@ block_t *DirBlock (access_t *p_access)
         }
         sub->parent = current;
         sub->handle = handle;
-        sub->filec = vlc_loaddir (handle, &sub->filev, visible, NULL);
+        sub->filec = vlc_loaddir (handle, &sub->filev, visible, collate);
         if (sub->filec < 0)
             sub->filev = NULL;
         sub->i = 0;



More information about the vlc-commits mailing list