Commit f0996b77 authored by Damien Fouilleul's avatar Damien Fouilleul

- getopt: use optind==0 for reentrency support and misc cleanup

parent d56d8c00
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#define _NO_PROTO #define _NO_PROTO
#endif #endif
/* Overkill. */
#include <vlc/vlc.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
......
...@@ -1484,7 +1484,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1484,7 +1484,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
* Parse the command line options * Parse the command line options
*/ */
opterr = 0; opterr = 0;
optind = 1; optind = 0; // set to 0 to tell GNU getopt to reinitialize
while( ( i_cmd = getopt_long( *pi_argc, ppsz_argv, psz_shortopts, while( ( i_cmd = getopt_long( *pi_argc, ppsz_argv, psz_shortopts,
p_longopts, &i_index ) ) != -1 ) p_longopts, &i_index ) ) != -1 )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment