main.c, shrink scope of `c' and `optind'

This commit is contained in:
rlar 2011-07-02 15:20:35 +00:00
parent e81f360f66
commit e8f01efc9c
1 changed files with 7 additions and 4 deletions

View File

@ -775,7 +775,7 @@ print_news(void)
int
main(int argc, char **argv)
{
int c, err;
int err;
bool gotone = FALSE;
bool addctrlsect = TRUE; /* PN: for autorun */
@ -867,7 +867,7 @@ main(int argc, char **argv)
/* --- Process command line options --- */
for(;;) {
int option_index = 0;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"version", 0, 0, 'v'},
@ -885,8 +885,11 @@ main(int argc, char **argv)
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "hvbac:ino:pqr:st:",
long_options, &option_index);
int option_index = 0;
int c = getopt_long (argc, argv, "hvbac:ino:pqr:st:",
long_options, &option_index);
if (c == -1)
break;