aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-04-30 00:31:01 -0500
committerRob Landley <rob@landley.net>2013-04-30 00:31:01 -0500
commit6938c0b78948bbec9f0a8853663eea5e7c614429 (patch)
treed461dc77b6adde38081a9e6753db6c0286ce6672
parentb3d4f0bb10b5591a2a87ed9f26aed21a16a7cf84 (diff)
downloadtoybox-6938c0b78948bbec9f0a8853663eea5e7c614429.tar.gz
Fix bare longopts to set unique optflag bits.
-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,