diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-08-24 20:35:51 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-08-24 20:35:51 +0200 |
commit | ba107f6bdba946c070ab5bcf4cd113e4f603e38e (patch) | |
tree | 27bcf80b986949b08ab767520bf492bff735bbdc /src | |
parent | m fix bash and java version (diff) | |
download | argparser-ba107f6bdba946c070ab5bcf4cd113e4f603e38e.tar.gz argparser-ba107f6bdba946c070ab5bcf4cd113e4f603e38e.tar.bz2 argparser-ba107f6bdba946c070ab5bcf4cd113e4f603e38e.tar.xz |
m c version
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/argparser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/argparser.c b/src/argparser.c index e0f53bf..1ec75f9 100644 --- a/src/argparser.c +++ b/src/argparser.c @@ -1408,11 +1408,12 @@ long args_parse(int argc, char** argv) { char* opt = args_optmap_get_standard(*(optqueue + i)); char* arg = argptr > i ? *(argqueue + i) : null; + if (argptr <= i) + args_optmap_trigger(opt, null); i++; if ((args_optmap_contains(opt) == false) || (args_opts_contains(opt) == false)) args_opts_new(opt); - if (argptr >= i) - args_opts_append(opt, arg); + args_opts_append(opt, arg); ((args_Array*)map_get(&args_opts, opt))->used = true; } } |