aboutsummaryrefslogtreecommitdiff
path: root/lib/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/args.c')
-rw-r--r--lib/args.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/args.c b/lib/args.c
index 748008f3..0efad075 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -245,7 +245,10 @@ void parse_optflaglist(struct getoptflagstate *gof)
options = end;
// Mark this struct opt as used, even when no short opt.
- if (!new->c) new->c = -1;
+ if (!new->c) {
+ new->c = -1;
+ new = 0;
+ }
// If this is the start of a new option that wasn't a longopt,