[vlc-commits] commit: system_Configure: do not depend on vlc_optind global ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Mon Mar 29 22:53:54 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 29 23:49:08 2010 +0300| [8c390d9ba7b2915d2f32fa28efe0e4a267717825] | committer: Rémi Denis-Courmont 

system_Configure: do not depend on vlc_optind global

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

 src/libvlc.c         |    2 +-
 src/win32/specific.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 3217b9b..61c296b 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -818,7 +818,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
 
     /* System specific configuration */
-    system_Configure( p_libvlc, i_argc, ppsz_argv );
+    system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
 
     /* Add service discovery modules */
     psz_modules = var_InheritString( p_libvlc, "services-discovery" );
diff --git a/src/win32/specific.c b/src/win32/specific.c
index 1fb2b20..e362e27 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -221,24 +221,24 @@ void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_
 
             /* We assume that the remaining parameters are filenames
              * and their input options */
-            if( i_argc - 1 >= vlc_optind )
+            if( i_argc > 0 )
             {
                 COPYDATASTRUCT wm_data;
                 int i_opt;
                 vlc_ipc_data_t *p_data;
                 size_t i_data = sizeof (*p_data);
 
-                for( i_opt = vlc_optind; i_opt < i_argc; i_opt++ )
+                for( i_opt = 0; i_opt < i_argc; i_opt++ )
                 {
                     i_data += sizeof (size_t);
                     i_data += strlen( ppsz_argv[ i_opt ] ) + 1;
                 }
 
                 p_data = malloc( i_data );
-                p_data->argc = i_argc - vlc_optind;
+                p_data->argc = i_argc;
                 p_data->enqueue = var_InheritBool( p_this, "playlist-enqueue" );
                 i_data = 0;
-                for( i_opt = vlc_optind; i_opt < i_argc; i_opt++ )
+                for( i_opt = 0; i_opt < i_argc; i_opt++ )
                 {
                     size_t i_len = strlen( ppsz_argv[ i_opt ] ) + 1;
                     /* Windows will never switch to an architecture



More information about the vlc-commits mailing list