* options) */
module_InitBank( p_libvlc );
- if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, true ) )
+ if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, NULL ) )
{
module_EndBank( p_libvlc, false );
return VLC_EGENERIC;
/*
* Override configuration with command line settings
*/
- /* config_LoadCmdLine(), DBus (below) and Win32-specific use vlc_optind,
- * vlc_optarg and vlc_optopt globals. This is not thread-safe!! */
-#warning BUG!
- if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, false ) )
+ int vlc_optind;
+ if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, &vlc_optind ) )
{
#ifdef WIN32
ShowConsole( false );
}
/* 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" );
* We assume that the remaining parameters are filenames
* and their input options.
*/
- msg_Info( p_libvlc, "optind = %u", vlc_optind );
GetFilenames( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
/*
* makes the environment unconsistent when libvlc is unloaded and
* should probably be moved to a safer place like vlc.c. */
static char psz_lcall[20];
- snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
- psz_lcall[19] = '\0';
+ snprintf( psz_lcall, sizeof(psz_lcall), "LC_ALL=%s", psz_lang );
putenv( psz_lcall );
#endif