]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
getopt: use stack instead of global variables, fixes #3366
[vlc] / src / libvlc.c
index 61c296b014ae9b66e8dbc971fdf060a2100bc804..ffd5242c3957fd53f1274ad47acd8249da290ef6 100644 (file)
@@ -321,7 +321,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
      * 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;
@@ -534,10 +534,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /*
      * 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 );