[vlc-devel] commit: module: Fix ':' usage and more largely previous commit. (Pierre d' Herbemont )

git version control git at videolan.org
Fri Mar 28 17:04:04 CET 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Fri Mar 28 16:52:53 2008 +0100| [38386dfd2b5352d7df1f4c873cf214e4790642b5]

module: Fix ':' usage and more largely previous commit.

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

 src/modules/modules.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/modules/modules.c b/src/modules/modules.c
index ba5a072..b60f9cb 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -936,6 +936,7 @@ static char * copy_next_paths_token( char * paths, char ** remaining_paths )
         else
             path[i] = paths[i];
     }
+    path[i] = 0;
 
     /* Return the remaining paths */
     if( remaining_paths ) {
@@ -954,15 +955,19 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
     char *paths, *path, *paths_iter;
 
 #if defined( WIN32 ) || defined( UNDER_CE )
-    const char * extra_path = "";
+    const char * extra_path = NULL;
 #else
-    const char * extra_path = ":" PLUGIN_PATH;
+    const char * extra_path = PLUGIN_PATH;
 #endif
 
     /* If the user provided a plugin path, we add it to the list */
     char * userpaths = config_GetPsz( p_this, "plugin-path" );
 
-    if( asprintf( &paths, "modules%s:plugins:%s", extra_path, userpaths ) < 0 )
+    if( asprintf( &paths, "modules%s%s"PATH_SEP"plugins%s%s",
+                    extra_path ? PATH_SEP : "",
+                    extra_path ? extra_path : "",
+                    userpaths ? PATH_SEP : "",
+                    userpaths ? userpaths : "" ) < 0 )
     {
         msg_Err( p_this, "Not enough memory" );
         free( userpaths );
@@ -975,7 +980,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
     for( paths_iter = paths; paths_iter; )
     {
         char *psz_fullpath;
- 
+
         path = copy_next_paths_token( paths_iter, &paths_iter );
         if( !path )
         {




More information about the vlc-devel mailing list