diff --git a/optparse.c b/optparse.c index fe4f7c1..474741f 100644 --- a/optparse.c +++ b/optparse.c @@ -139,7 +139,7 @@ void optparse_init(struct optparse *options, char **argv) { options->argv = argv; options->permute = 1; - options->optind = 1; + options->optind = argv[0] != 0; options->subopt = 0; options->optarg = 0; options->errmsg[0] = '\0';