From 41c126a7ce320c078b9c699141cf35d281287be3 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 9 Mar 2000 07:49:35 +0000 Subject: [PATCH] (arg_match_short): backup optind when there's a missing argument so that the error can point at the flag and not the non-existant argument git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8026 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/getarg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/roken/getarg.c b/lib/roken/getarg.c index dc55edabd..cfdc287ab 100644 --- a/lib/roken/getarg.c +++ b/lib/roken/getarg.c @@ -461,8 +461,10 @@ arg_match_short (struct getargs *args, size_t num_args, ++*optind; optarg = rargv[*optind]; } - if(optarg == NULL) + if(optarg == NULL) { + --*optind; return ARG_ERR_NO_ARG; + } if(args[k].type == arg_integer) { int tmp; if(sscanf(optarg, "%d", &tmp) != 1)