diff options
author | Rob Landley <rob@landley.net> | 2012-12-27 18:44:37 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-12-27 18:44:37 -0600 |
commit | 6d91e0fcaa4e80eac6053ea14944537d7a6a057b (patch) | |
tree | 0ade278b6b379b57868e06346968924d2ba62074 /lib | |
parent | bf1e70f3554c2f591e15df7abca03138861e5c6c (diff) | |
download | toybox-6d91e0fcaa4e80eac6053ea14944537d7a6a057b.tar.gz |
Fix option grouping.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/args.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -132,7 +132,8 @@ static int gotflag(struct getoptflagstate *gof, struct opts *opt) struct opts *bad; unsigned i = 1; - for (bad=gof->opts; gof->excludes && i; bad = bad->next) i<<=1; + for (bad=gof->opts; opt == bad || !(gof->excludes & i); bad = bad->next) + i<<=1; error_exit("No '%c' with '%c'", opt->c, bad->c); } @@ -292,7 +293,7 @@ void parse_optflaglist(struct getoptflagstate *gof) while (*options) { unsigned bits = 0; - if (CFG_TOYBOX_DEBUG && *options) error_exit("trailing %s", options); + if (CFG_TOYBOX_DEBUG && *options != '[') error_exit("trailing %s", options); idx = stridx("-|!+", *++options); if (CFG_TOYBOX_DEBUG && idx == -1) error_exit("[ needs +-!"); |