mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Replace collate_range_cmp call with its code (GNU version)
This commit is contained in:
parent
8bd603338f
commit
d635f7bb20
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19284
@ -21,9 +21,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -121,6 +118,23 @@ static char **comsubs _RE_ARGS((char *left, char *right));
|
||||
static char **addlists _RE_ARGS((char **old, char **new));
|
||||
static char **inboth _RE_ARGS((char **left, char **right));
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ptr_t
|
||||
xcalloc(n, s)
|
||||
size_t n;
|
||||
|
@ -21,9 +21,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
@ -68,6 +65,23 @@ typedef char *ptr_t;
|
||||
|
||||
static void dfamust();
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ptr_t
|
||||
xcalloc(n, s)
|
||||
int n;
|
||||
|
Loading…
Reference in New Issue
Block a user