[PATCH] ls: make -C exclusive with -l and -1 (bug 2959).

Denys Vlasenko vda.linux at googlemail.com
Sun Dec 19 04:44:21 UTC 2010


On Saturday 18 December 2010 16:45, James Youngman wrote:
> That patch increases the size of the text segment by 53 bytes (on my
> system at least), I hope that's within the realms of the acceptable.
>  We could recover some of this by removing the useless
> LIST_MASK_TRIGGER feature, however, rather than do that immediately I
> wanted to discuss the foo_TRIGGER usage in general in ls.c and options
> for fully fixing bug 2959.
> 
> The foo_TRIGGER mechanism appears to be an attempt to deal with
> mutually-exclusive options, and indeed does so in a way, but since it
> considers the options in the order they appear in opt_flags rather
> than the order they appear on the command line, it will resolve
> options conflicts deterministically but in a way that doesn't depend
> on the option order specified by the user.

Yes, looks that way. The code looks rusty: LIST_MASK_TRIGGER is 0
and can be removed, DISP_MASK_TRIGGER is strange and looks wrong,
BTW, -x lacks STYLE_COLUMNS. Fixing...

> The existing code in 
> getopt32 for resolving this requires conflicting options to have no
> bits set in common and at the moment this isn't true for options like 
> -c and -u.

Huh? getopt32 can't assign the same bit to two options.

-- 
vda


More information about the busybox mailing list