[patch] shell/ash.c: mimics dash WRT set [+-]o
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Tue May 6 10:51:54 PDT 2008
On Tue, 6 May 2008, Denys Vlasenko wrote:
> On Sunday 04 May 2008 14:23, Cristian Ionescu-Idbohrn wrote:
> > It also replicates reality in some error messages, like:
> >
>
> Applied, thanks
Great.
By the way, is there a style rule to hold to when it comes to use of
curly brackets? I find this in one and the same file shell/ash.c:
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));
}
and a few lines down, this:
for (i = 0; i < NOPTS; i++) {
if (optletters(i) == flag) {
optlist[i] = val;
return;
}
}
Also, one liners:
if (cmdline)
minusc = NULL;
but also:
if (*argptr != NULL) {
setparam(argptr);
}
Cheers,
--
Cristian
More information about the busybox
mailing list