summaryrefslogtreecommitdiffstats
path: root/lib/libcompat
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-31 04:55:47 +0000
committerache <ache@FreeBSD.org>1996-10-31 04:55:47 +0000
commit1890d8d6a5941127257717012752b788e83ede8f (patch)
tree481e389d22ac58a57108b829fcdcf11c82c35555 /lib/libcompat
parent81ff4cc5c70913a041def6d0e3d6fd7b1d8f51be (diff)
downloadFreeBSD-src-1890d8d6a5941127257717012752b788e83ede8f.zip
FreeBSD-src-1890d8d6a5941127257717012752b788e83ede8f.tar.gz
Replace collate_range_cmp call with its code
Diffstat (limited to 'lib/libcompat')
-rw-r--r--lib/libcompat/regexp/regexp.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/libcompat/regexp/regexp.c b/lib/libcompat/regexp/regexp.c
index 963d6ab..a442b96 100644
--- a/lib/libcompat/regexp/regexp.c
+++ b/lib/libcompat/regexp/regexp.c
@@ -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
*
OpenPOWER on IntegriCloud