From 71018396d18d81687c813c5a5d83309a78908bb8 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 31 Oct 1996 07:36:09 +0000 Subject: Replace collate_range_cmp call by its code (GNU version) --- gnu/usr.bin/sort/sort.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gnu/usr.bin') diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c index f4d6127..bb391a0 100644 --- a/gnu/usr.bin/sort/sort.c +++ b/gnu/usr.bin/sort/sort.c @@ -200,6 +200,22 @@ static int collates[UCHAR_LIM]; #define COLLDIFF(A, B) (collates[UCHAR (A)] - collates[UCHAR (B)]) +/* static */ int +collate_range_cmp (a, b) + int a, b; +{ + int r; + static char s[2][2]; + + if ((unsigned char)a == (unsigned char)b) + return 0; + s[0][0] = a; + s[1][0] = b; + if ((r = strcoll(s[0], s[1])) == 0) + r = (unsigned char)a - (unsigned char)b; + return r; +} + static int collcompare (const void *sa, const void *sb) { -- cgit v1.1