diff options
Diffstat (limited to 'src/sort.c')
| -rw-r--r-- | src/sort.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/sort.c b/src/sort.c index b9ae19883..0213fee1f 100644 --- a/src/sort.c +++ b/src/sort.c @@ -30,6 +30,7 @@ #include "argmatch.h" #include "error.h" #include "filevercmp.h" +#include "hard-locale.h" #include "hash.h" #include "md5.h" #include "physmem.h" @@ -414,7 +415,7 @@ The locale specified by the environment affects sort order.\n\ Set LC_ALL=C to get the traditional sort order that uses\n\ native byte values.\n\ "), stdout ); - emit_bug_reporting_address (); + emit_ancillary_info (); } exit (status); @@ -1473,7 +1474,7 @@ limfield (const struct line *line, const struct keyfield *key) { while (ptr < lim && *ptr != tab) ++ptr; - if (ptr < lim && (eword | echar)) + if (ptr < lim && (eword || echar)) ++ptr; } else @@ -2029,7 +2030,7 @@ keycompare (const struct line *a, const struct line *b) if (key->random) diff = compare_random (texta, lena, textb, lenb); - else if (key->numeric | key->general_numeric | key->human_numeric) + else if (key->numeric || key->general_numeric || key->human_numeric) { char savea = *lima, saveb = *limb; @@ -2194,7 +2195,7 @@ compare (const struct line *a, const struct line *b) if (keylist) { diff = keycompare (a, b); - if (diff | unique | stable) + if (diff || unique || stable) return diff; } @@ -3298,7 +3299,7 @@ main (int argc, char **argv) { bool minus_pos_usage = (optind != argc && argv[optind][0] == '-' && ISDIGIT (argv[optind][1])); - obsolete_usage |= minus_pos_usage & ~posixly_correct; + obsolete_usage |= minus_pos_usage && !posixly_correct; if (obsolete_usage) { /* Treat +POS1 [-POS2] as a key if possible; but silently @@ -3307,7 +3308,7 @@ main (int argc, char **argv) s = parse_field_count (optarg + 1, &key->sword, NULL); if (s && *s == '.') s = parse_field_count (s + 1, &key->schar, NULL); - if (! (key->sword | key->schar)) + if (! (key->sword || key->schar)) key->sword = SIZE_MAX; if (! s || *set_ordering (s, key, bl_start)) key = NULL; @@ -3398,7 +3399,7 @@ main (int argc, char **argv) badfieldspec (optarg, N_("character offset is zero")); } } - if (! (key->sword | key->schar)) + if (! (key->sword || key->schar)) key->sword = SIZE_MAX; s = set_ordering (s, key, bl_start); if (*s != ',') @@ -3587,14 +3588,14 @@ main (int argc, char **argv) if (! (key->ignore || key->translate || (key->skipsblanks - | key->reverse - | key->skipeblanks - | key->month - | key->numeric - | key->version - | key->general_numeric - | key->human_numeric - | key->random))) + || key->reverse + || key->skipeblanks + || key->month + || key->numeric + || key->version + || key->general_numeric + || key->human_numeric + || key->random))) { key->ignore = gkey.ignore; key->translate = gkey.translate; @@ -3615,13 +3616,13 @@ main (int argc, char **argv) if (!keylist && (gkey.ignore || gkey.translate || (gkey.skipsblanks - | gkey.skipeblanks - | gkey.month - | gkey.numeric - | gkey.general_numeric - | gkey.human_numeric - | gkey.random - | gkey.version))) + || gkey.skipeblanks + || gkey.month + || gkey.numeric + || gkey.general_numeric + || gkey.human_numeric + || gkey.random + || gkey.version))) { insertkey (&gkey); need_random |= gkey.random; |
