From b43e6a52a5e5b115217b885845839f75065ee1e6 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 26 Jul 2022 16:55:23 -0400 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=8A=E6=B8=B8=20https://?= =?UTF-8?q?github.com/skeeto/optparse/commit/cdc96b235343c8cf6475482075371?= =?UTF-8?q?b249b2187d6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- optparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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';