From 6938c0b78948bbec9f0a8853663eea5e7c614429 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 30 Apr 2013 00:31:01 -0500 Subject: Fix bare longopts to set unique optflag bits. --- lib/args.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3