diff options
author | ache <ache@FreeBSD.org> | 1996-10-31 14:38:09 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-10-31 14:38:09 +0000 |
commit | 1a9b70dd3e991465b4759538dc7c8131de621156 (patch) | |
tree | 1a0cf2672a14ff9983f55947614e9198a785a2d2 /games/fortune/strfile | |
parent | 7c5a2b76a65182b32831e0a0953769029b147570 (diff) | |
download | FreeBSD-src-1a9b70dd3e991465b4759538dc7c8131de621156.zip FreeBSD-src-1a9b70dd3e991465b4759538dc7c8131de621156.tar.gz |
Replace collate_range_cmp call with its code
Diffstat (limited to 'games/fortune/strfile')
-rw-r--r-- | games/fortune/strfile/strfile.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 |