From 8c390d9ba7b2915d2f32fa28efe0e4a267717825 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 29 Mar 2010 23:49:08 +0300 Subject: [PATCH] system_Configure: do not depend on vlc_optind global --- 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 3217b9be1b..61c296b014 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 1fb2b20655..e362e273b2 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 -- 2.39.5