mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
Replace collate_range_cmp call with its code
This commit is contained in:
parent
c61cea7272
commit
7a15396329
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19278
@ -33,7 +33,6 @@
|
||||
* regular-expression syntax might require a total rethink.
|
||||
*/
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <regexp.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
@ -182,10 +181,28 @@ STATIC void regc();
|
||||
STATIC void reginsert();
|
||||
STATIC void regtail();
|
||||
STATIC void regoptail();
|
||||
STATIC int collate_range_cmp();
|
||||
#ifdef STRCSPN
|
||||
STATIC int strcspn();
|
||||
#endif
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
- regcomp - compile a regular expression into internal code
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user