diff options
author | Rob Landley <rob@landley.net> | 2013-04-30 00:31:01 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-04-30 00:31:01 -0500 |
commit | 6938c0b78948bbec9f0a8853663eea5e7c614429 (patch) | |
tree | d461dc77b6adde38081a9e6753db6c0286ce6672 | |
parent | b3d4f0bb10b5591a2a87ed9f26aed21a16a7cf84 (diff) | |
download | toybox-6938c0b78948bbec9f0a8853663eea5e7c614429.tar.gz |
Fix bare longopts to set unique optflag bits.
-rw-r--r-- | lib/args.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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, |