From f0996b778d66cd7c9a43c71f918288bf4580d6b1 Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Wed, 21 Mar 2007 12:34:11 +0000 Subject: [PATCH] - getopt: use optind==0 for reentrency support and misc cleanup --- src/extras/getopt.c | 3 --- src/misc/configuration.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/extras/getopt.c b/src/extras/getopt.c index eb0bf0df0a..5e269b4309 100644 --- a/src/extras/getopt.c +++ b/src/extras/getopt.c @@ -30,9 +30,6 @@ #define _NO_PROTO #endif -/* Overkill. */ -#include - #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/misc/configuration.c b/src/misc/configuration.c index e889cb45a4..3d4df0b759 100644 --- a/src/misc/configuration.c +++ b/src/misc/configuration.c @@ -1484,7 +1484,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], * Parse the command line options */ 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, p_longopts, &i_index ) ) != -1 ) { -- 2.39.2