rename optind to optidx

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15441 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-06-16 20:05:31 +00:00
parent 622777b1ce
commit 4eaa507264

View File

@@ -59,10 +59,10 @@ main(int argc, char **argv)
int ret; int ret;
const char *file; const char *file;
const char *name = NULL; const char *name = NULL;
int optind = 0; int optidx = 0;
setprogname(argv[0]); setprogname(argv[0]);
if(getarg(args, num_args, argc, argv, &optind)) if(getarg(args, num_args, argc, argv, &optidx))
usage(1); usage(1);
if(help_flag) if(help_flag)
usage(0); usage(0);
@@ -70,16 +70,16 @@ main(int argc, char **argv)
print_version(NULL); print_version(NULL);
exit(0); exit(0);
} }
if (argc == optind) { if (argc == optidx) {
file = "stdin"; file = "stdin";
name = "stdin"; name = "stdin";
yyin = stdin; yyin = stdin;
} else { } else {
file = argv[optind]; file = argv[optidx];
yyin = fopen (file, "r"); yyin = fopen (file, "r");
if (yyin == NULL) if (yyin == NULL)
err (1, "open %s", file); err (1, "open %s", file);
name = argv[optind + 1]; name = argv[optidx + 1];
} }
init_generate (file, name); init_generate (file, name);