Convert to newly aded collate compare function

This commit is contained in:
Andrey A. Chernov 1996-08-12 18:56:38 +00:00
parent 79deb12410
commit acd9f20695
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93 # @(#)Makefile 8.1 (Berkeley) 6/4/93
LIB=compat LIB=compat
CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS
AINC= -I${.CURDIR}/../libc/${MACHINE} AINC= -I${.CURDIR}/../libc/${MACHINE}
NOPIC= NOPIC=

View File

@ -32,13 +32,14 @@
* precedence is structured in regular expressions. Serious changes in * precedence is structured in regular expressions. Serious changes in
* regular-expression syntax might require a total rethink. * regular-expression syntax might require a total rethink.
*/ */
#include <limits.h>
#include <locale.h>
#include <regexp.h> #include <regexp.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "regmagic.h" #include "regmagic.h"
#include "collate.h"
/* /*
* The "internal use only" fields in regexp.h are present to pass info from * The "internal use only" fields in regexp.h are present to pass info from
@ -507,12 +508,12 @@ int *flagp;
else { else {
class = UCHARAT(regparse-2); class = UCHARAT(regparse-2);
classend = UCHARAT(regparse); classend = UCHARAT(regparse);
if (__collcmp(class, classend) > 0) if (collate_range_cmp(class, classend) > 0)
FAIL("invalid [] range"); FAIL("invalid [] range");
for (i = 0; i <= UCHAR_MAX; i++) for (i = 0; i <= UCHAR_MAX; i++)
if ( i != class if ( i != class
&& __collcmp(class, i) <= 0 && collate_range_cmp(class, i) <= 0
&& __collcmp(i, classend) <= 0 && collate_range_cmp(i, classend) <= 0
) )
regc(i); regc(i);
regparse++; regparse++;