changeset 770:1455c09e3f8a

Fix option grouping.
author Rob Landley <rob@landley.net>
date Thu, 27 Dec 2012 18:44:37 -0600
parents 098ab2654fa0
children 4ca4134dad17
files lib/args.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/args.c	Thu Dec 27 17:09:17 2012 -0600
+++ b/lib/args.c	Thu Dec 27 18:44:37 2012 -0600
@@ -132,7 +132,8 @@
     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 @@
   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 +-!");