[Toybox] [groups] : ! More than one in group is error

Ashwini Sharma ak.ashwini at gmail.com
Wed Dec 26 20:24:53 PST 2012


Hey Rob,

 Options mutual exclusion handling is having a Seg Fault in function
gotflag.
The block handling this doesn't have a terminating condition, hence once it
goes beyond the options list, it crashes.

At my end I have modified the code block from
if (toys.optflags & gof->excludes) {
    struct opts *bad;
    unsigned i =
1;


  *  for (bad=gof->opts; (gof->excludes && i; bad = bad->next) i<<=1;*
    error_exit("No '%c' with '%c'", opt->c, bad->c);
  }

to

if (toys.optflags & gof->excludes) {
    struct opts *bad;
    unsigned i =
1;


   * gof->excludes &= ~opt->dex[1];
    for (bad=gof->opts; bad && !(gof->excludes & i & toys.optflags) ; bad =
bad->next) i<<=1;*
    error_exit("No '%c' with '%c'", opt->c, bad->c);
  }

Please have a look and add the same to the mainline.

regards,
Ashwini Kumar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20121227/34d4091d/attachment-0004.htm>


More information about the Toybox mailing list