diff options
author | ache <ache@FreeBSD.org> | 1996-08-12 19:12:40 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-08-12 19:12:40 +0000 |
commit | 1563880d65c4bda89a2d4c4504dd8b0f834322d4 (patch) | |
tree | b437f72d86724f3099f35375ef5f8c44a907f610 /gnu/usr.bin | |
parent | 62d22e65bdcc1a114ff10a64c5d89c2bda26339b (diff) | |
download | FreeBSD-src-1563880d65c4bda89a2d4c4504dd8b0f834322d4.zip FreeBSD-src-1563880d65c4bda89a2d4c4504dd8b0f834322d4.tar.gz |
Convert to newly aded collate compare function
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/sort/sort.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c index 0dbc719..f4d6127 100644 --- a/gnu/usr.bin/sort/sort.c +++ b/gnu/usr.bin/sort/sort.c @@ -203,31 +203,7 @@ static int collates[UCHAR_LIM]; static int collcompare (const void *sa, const void *sb) { - int A = *((int *)sa), B = *((int *)sb); - static char s1[2], s2[2]; - - if (A == B) - return (0); - if (isascii(A) && isascii(B) || !isalpha(A) && !isalpha(B)) - return (A - B); - if (isupper(A) && islower(B)) - return (-1); - else if (islower(A) && isupper(B)) - return (1); - if (isalpha(A) && !isalpha(B)) { - if (isupper(A)) - return ('A' - B); - else - return ('a' - B); - } else if (isalpha(B) && !isalpha(A)) { - if (isupper(B)) - return (A - 'A'); - else - return (A - 'a'); - } - s1[0] = A; - s2[0] = B; - return strcoll(s1, s2); + return collate_range_cmp (*((int *)sa), *((int *)sb)); } static void |