From 7626438832cee94d107b16d8f4d630cdb1728006 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 5 Feb 1996 23:40:13 +0000 Subject: (argp_parse): Implement the ARG_NUM field. --- libshouldbeinlibc/argp-parse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libshouldbeinlibc') diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c index fb1d9d44..47bbdd0e 100644 --- a/libshouldbeinlibc/argp-parse.c +++ b/libshouldbeinlibc/argp-parse.c @@ -162,7 +162,7 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, /* A pointer for people to use for iteration over GROUPS. */ struct group *group; /* State block supplied to parsing routines. */ - struct argp_state state = { argp, argc, argv, 0, flags }; + struct argp_state state = { argp, argc, argv, 0, flags, 0 }; if (! (state.flags & ARGP_NO_HELP)) /* Add our own options. */ @@ -357,7 +357,10 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, /* Remember that we successfully processed a non-option argument -- but only if the user hasn't gotten tricky and set the clock back. */ - (--group)->processed_arg = 1; + { + (--group)->processed_arg = 1; + state.arg_num++; + } } else if (group_key == 0) /* A short option. */ -- cgit v1.2.3