summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-02-05 23:40:13 +0000
committerMiles Bader <miles@gnu.org>1996-02-05 23:40:13 +0000
commit7626438832cee94d107b16d8f4d630cdb1728006 (patch)
tree8f3880080e0109eaeb244101afe9fcc3e12dafed
parent9d3a83a2ef8dd13ed2f88f3b8dc6b0c663f10c6e (diff)
(argp_parse): Implement the ARG_NUM field.
-rw-r--r--libshouldbeinlibc/argp-parse.c7
1 files changed, 5 insertions, 2 deletions
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. */