sort.c: remove a magic number from compare_keys()
authorBartosz Golaszewski <bartekgola@gmail.com>
Sat, 18 Jan 2014 14:25:58 +0000 (15:25 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 19 Jan 2014 05:47:06 +0000 (06:47 +0100)
Use bitwise OR of proper flags instead.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/sort.c

index a1625fc9cdb30a6d332ba023ef901ff6abac172d..0b3b650c9de140163afcb451bef08da9721ebab4 100644 (file)
@@ -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;