From ba107f6bdba946c070ab5bcf4cd113e4f603e38e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Aug 2013 20:35:51 +0200 Subject: m c version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3-70-g09d2