[PATCH 1/2] sort.c: remove a magic number from compare_keys()

Denys Vlasenko vda.linux at googlemail.com
Sun Jan 19 05:55:54 UTC 2014


Applied, thanks!

On Sat, Jan 18, 2014 at 3:25 PM, Bartosz Golaszewski
<bartekgola at gmail.com> wrote:
> Use bitwise OR of proper flags instead.
>
> Signed-off-by: Bartosz Golaszewski <bartekgola at gmail.com>
> ---
>  coreutils/sort.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/coreutils/sort.c b/coreutils/sort.c
> index a1625fc..0b3b650 100644
> --- a/coreutils/sort.c
> +++ b/coreutils/sort.c
> @@ -225,7 +225,7 @@ static int compare_keys(const void *xarg, const void *yarg)
>                 y = *(char **)yarg;
>  #endif
>                 /* Perform actual comparison */
> -               switch (flags & 7) {
> +               switch (flags & (FLAG_n | FLAG_M | FLAG_g)) {
>                 default:
>                         bb_error_msg_and_die("unknown sort type");
>                         break;
> --
> 1.7.10.4
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list