]> git.sesse.net Git - vlc/commitdiff
- getopt: use optind==0 for reentrency support and misc cleanup
authorDamien Fouilleul <damienf@videolan.org>
Wed, 21 Mar 2007 12:34:11 +0000 (12:34 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Wed, 21 Mar 2007 12:34:11 +0000 (12:34 +0000)
src/extras/getopt.c
src/misc/configuration.c

index eb0bf0df0ab01935668d2071471c60719c0a10ca..5e269b430931894aa0ba8ba507e0bea6fe7a0d94 100644 (file)
@@ -30,9 +30,6 @@
 #define _NO_PROTO
 #endif
 
-/* Overkill. */
-#include <vlc/vlc.h>
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
index e889cb45a496fd1f2f46bae2d0c9bec9ce0ccd4c..3d4df0b7597c2986dc33d05fbefc79fb6d9ff1aa 100644 (file)
@@ -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 )
     {