[patch] shell/ash.c: mimics dash WRT set [+-]o
Paul Fox
pgf at brightstareng.com
Tue May 6 19:27:18 UTC 2008
> On Tuesday 06 May 2008 19:51, Cristian Ionescu-Idbohrn wrote:
> >
> > for (i = 0; i < NOPTS; i++)
> > if (val) {
> > out1fmt("%-16s%s\n", optnames(i), optlist[i] ? "on" : "off");
> > } else {
> > out1fmt("set %co %s\n", optlist[i] ? '-' : '+', optnames(i));
> > }
while i agree with denys about the one-liners, i think code like
the above should probably have braces added, at least as soon as
someone needs to touch the code for some other reason. this kind
of thing is a bug (or at least a misunderstanding) just waiting
to happen.
paul
=---------------------
paul fox, pgf at brightstareng.com
More information about the busybox
mailing list