projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46e8e1d
)
Make [-abc] exclude logic clear argument slots when disabling options.
author
Rob Landley
<rob@landley.net>
Fri, 6 Sep 2013 17:18:46 +0000
(12:18 -0500)
committer
Rob Landley
<rob@landley.net>
Fri, 6 Sep 2013 17:18:46 +0000
(12:18 -0500)
lib/args.c
patch
|
blob
|
history
diff --git
a/lib/args.c
b/lib/args.c
index
73063d6
..
f6bc482
100644
(file)
--- a/
lib/args.c
+++ b/
lib/args.c
@@
-124,7
+124,14
@@
static int gotflag(struct getoptflagstate *gof, struct opts *opt)
}
// Set flags
- toys.optflags &= ~opt->dex[0];
+ if (toys.optflags & opt->dex[0]) {
+ struct opts *clr;
+ unsigned i = 1;
+
+ for (clr=gof->opts, i=1; ; clr = clr->next, i<<=1)
+ if (clr->arg && (i & toys.optflags)) clr->arg = 0;
+ toys.optflags &= ~opt->dex[0];
+ }
toys.optflags |= opt->dex[1];
gof->excludes |= opt->dex[2];
if (opt->flags&2) gof->stopearly=2;