[vlc-devel] commit: Cleanup directory URI encoding ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Oct 30 21:10:18 CET 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Oct 30 22:08:59 2008 +0200| [5d974e629ec3380490cf14cd344819debe9b350d] | committer: Rémi Denis-Courmont 

Cleanup directory URI encoding

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

 modules/access/directory.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index 1fffcef..9b9705a 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -343,8 +343,8 @@ static block_t *Block (access_t *p_access)
         return NULL;
     }
 
-    /* Skip current and parent directories */
-    if (entry[0] == '.' )
+    /* Skip current, parent and hidden directories */
+    if (entry[0] == '.')
         return NULL;
     /* Handle recursion */
     if (p_sys->mode != MODE_COLLAPSE)
@@ -360,7 +360,12 @@ static block_t *Block (access_t *p_access)
         {
             sub->parent = current;
             sub->handle = handle;
-            sub->uri = encode_path (sub->path);
+
+            char *encoded = encode_URI_component (entry);
+            if ((encoded == NULL)
+             || (asprintf (&sub->uri, "%s/%s", current->uri, encoded) == -1))
+                 sub->uri = NULL;
+            free (encoded);
 
             if ((p_sys->mode == MODE_NONE)
              || fstat (dirfd (handle), &sub->st)




More information about the vlc-devel mailing list