From 1a9b70dd3e991465b4759538dc7c8131de621156 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 31 Oct 1996 14:38:09 +0000 Subject: Replace collate_range_cmp call with its code --- games/fortune/strfile/strfile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'games') diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 71f4780..1d58b53 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -350,6 +350,23 @@ void do_order() Tbl.str_flags |= STR_ORDERED; } +/* static */ int collate_range_cmp (c1, c2) + int c1, c2; +{ + static char s1[2], s2[2]; + int ret; + + c1 &= UCHAR_MAX; + c2 &= UCHAR_MAX; + if (c1 == c2) + return (0); + s1[0] = c1; + s2[0] = c2; + if ((ret = strcoll(s1, s2)) != 0) + return (ret); + return (c1 - c2); +} + /* * cmp_str: * Compare two strings in the file -- cgit v1.1