From: RĂ©mi Denis-Courmont Date: Mon, 29 Mar 2010 19:30:10 +0000 (+0300) Subject: getopt: remove useless global variable X-Git-Tag: 1.1.0-pre1~256 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=69cd826772892b0691bb4cb5fe182b8008eb8c42;p=vlc getopt: remove useless global variable --- diff --git a/src/config/getopt.c b/src/config/getopt.c index bec9fa3aed..8c5b89099a 100644 --- a/src/config/getopt.c +++ b/src/config/getopt.c @@ -66,12 +66,6 @@ char *vlc_optarg = NULL; /* 1003.2 says this must be 1 before any call. */ int vlc_optind = 1; -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -static int vlc_getopt_initialized = 0; - /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. @@ -303,11 +297,10 @@ int { vlc_optarg = NULL; - if (!vlc_getopt_initialized || vlc_optind == 0) + if (vlc_optind == 0) { optstring = vlc_getopt_initialize(argc, argv, optstring); vlc_optind = 1; /* Don't scan ARGV[0], the program name. */ - vlc_getopt_initialized = 1; } #define NONOPTION_P (argv[vlc_optind][0] != '-' || argv[vlc_optind][1] == '\0')