Convert to newly aded collate compare function
This commit is contained in:
parent
883a3266d1
commit
79deb12410
@ -44,8 +44,8 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
|
||||
*/
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include "collate.h"
|
||||
|
||||
#define EOS '\0'
|
||||
|
||||
@ -163,8 +163,8 @@ rangematch(pattern, test, flags)
|
||||
c2 = *pattern++;
|
||||
if (c2 == EOS)
|
||||
return (NULL);
|
||||
if ( __collcmp(c, test) <= 0
|
||||
&& __collcmp(test, c2) <= 0
|
||||
if ( collate_range_cmp(c, test) <= 0
|
||||
&& collate_range_cmp(test, c2) <= 0
|
||||
)
|
||||
ok = 1;
|
||||
} else if (c == test)
|
||||
|
@ -70,12 +70,12 @@ static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <glob.h>
|
||||
#include <locale.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "collate.h"
|
||||
|
||||
#define DOLLAR '$'
|
||||
#define DOT '.'
|
||||
@ -703,8 +703,8 @@ match(name, pat, patend)
|
||||
++pat;
|
||||
while (((c = *pat++) & M_MASK) != M_END)
|
||||
if ((*pat & M_MASK) == M_RNG) {
|
||||
if ( __collcmp(CHAR(c), CHAR(k)) <= 0
|
||||
&& __collcmp(CHAR(k), CHAR(pat[1])) <= 0
|
||||
if ( collate_range_cmp(CHAR(c), CHAR(k)) <= 0
|
||||
&& collate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0
|
||||
)
|
||||
ok = 1;
|
||||
pat += 2;
|
||||
|
@ -46,6 +46,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <regex.h>
|
||||
|
||||
@ -54,7 +55,6 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
|
||||
|
||||
#include "cclass.h"
|
||||
#include "cname.h"
|
||||
#include "collate.h"
|
||||
|
||||
/*
|
||||
* parse structure, passed up and down to avoid global variables and
|
||||
@ -803,10 +803,10 @@ register cset *cs;
|
||||
if (start == finish)
|
||||
CHadd(cs, start);
|
||||
else {
|
||||
(void)REQUIRE(__collcmp(start, finish) <= 0, REG_ERANGE);
|
||||
(void)REQUIRE(collate_range_cmp(start, finish) <= 0, REG_ERANGE);
|
||||
for (i = CHAR_MIN; i <= CHAR_MAX; i++) {
|
||||
if ( __collcmp(start, i) <= 0
|
||||
&& __collcmp(i, finish) <= 0
|
||||
if ( collate_range_cmp(start, i) <= 0
|
||||
&& collate_range_cmp(i, finish) <= 0
|
||||
)
|
||||
CHadd(cs, i);
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
|
||||
*/
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include "collate.h"
|
||||
|
||||
#define EOS '\0'
|
||||
|
||||
@ -163,8 +163,8 @@ rangematch(pattern, test, flags)
|
||||
c2 = *pattern++;
|
||||
if (c2 == EOS)
|
||||
return (NULL);
|
||||
if ( __collcmp(c, test) <= 0
|
||||
&& __collcmp(test, c2) <= 0
|
||||
if ( collate_range_cmp(c, test) <= 0
|
||||
&& collate_range_cmp(test, c2) <= 0
|
||||
)
|
||||
ok = 1;
|
||||
} else if (c == test)
|
||||
|
Loading…
x
Reference in New Issue
Block a user