diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1996-10-31 04:55:47 +0000 | 
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1996-10-31 04:55:47 +0000 | 
| commit | 7a15396329f0531e8712c8b2100a8ce33a290314 (patch) | |
| tree | 481e389d22ac58a57108b829fcdcf11c82c35555 /lib/libcompat/regexp | |
| parent | c61cea7272afe7054b72a38e37bd8c5215e91f41 (diff) | |
Notes
Diffstat (limited to 'lib/libcompat/regexp')
| -rw-r--r-- | lib/libcompat/regexp/regexp.c | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/lib/libcompat/regexp/regexp.c b/lib/libcompat/regexp/regexp.c index 963d6abc1b49..a442b962cfd2 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   * | 
