diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1996-10-31 07:36:09 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1996-10-31 07:36:09 +0000 |
| commit | 8bd603338f3fec74175a6159881745e4c183c474 (patch) | |
| tree | a39c79b95738645d6fc4790836f0f0fccb250685 /gnu/usr.bin/sort | |
| parent | a082293830f6cea5f347fa0ad55f92db4b4082a7 (diff) | |
Notes
Diffstat (limited to 'gnu/usr.bin/sort')
| -rw-r--r-- | gnu/usr.bin/sort/sort.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c index f4d6127c3d6e..bb391a0a0aff 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) { |
