bb_opt_complementally and STANDALONE_SHELL

Shaun Jackman sjackman at gmail.com
Fri Jul 7 10:55:58 PDT 2006


When STANDALONE_SHELL is used on a vfork system, if an applet sets
bb_opt_complementally, it will remain set when the shell calls the
next applet. This issue is similar to the shell needing to clear
optind before calling the next applet. Either bb_opt_complementally
could be cleared in the same place that optind is cleared, or
bb_opt_complementally could become an argument to bb_getopt_ulflags,
which is arguably the cleaner choice. The parameter
bb_applet_long_options suffers from the same situation.

Proposal...

extern const char *bb_opt_complementally;
extern const struct option *bb_applet_long_options;
extern unsigned long bb_getopt_ulflags(int argc, char **argv,
const char *applet_opts, ...);

... becomes...

extern unsigned long bb_getopt_ulflags(int argc, char **argv,
const char *applet_opts, const char *bb_opt_complementally,
const struct option *bb_applet_long_options, ...);

Opinions?

As a nice bonus, we can finally fix the spelling of complementally [sic].

Cheers,
Shaun


More information about the busybox mailing list