[vlc-commits] commit: getopt: remove useless global variable ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Mon Mar 29 21:30:29 CEST 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 29 22:30:10 2010 +0300| [69cd826772892b0691bb4cb5fe182b8008eb8c42] | committer: Rémi Denis-Courmont
getopt: remove useless global variable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=69cd826772892b0691bb4cb5fe182b8008eb8c42
---
src/config/getopt.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/src/config/getopt.c b/src/config/getopt.c
index bec9fa3..8c5b890 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')
More information about the vlc-commits
mailing list