Use collate for alpha character ranges

This commit is contained in:
Andrey A. Chernov 1996-08-12 04:03:50 +00:00
parent c73ac73fb4
commit 36a00a4b79
2 changed files with 8 additions and 2 deletions

View File

@ -45,6 +45,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#include <fnmatch.h>
#include <string.h>
#include "collate.h"
#define EOS '\0'
@ -162,7 +163,9 @@ rangematch(pattern, test, flags)
c2 = *pattern++;
if (c2 == EOS)
return (NULL);
if (c <= test && test <= c2)
if ( __collcmp(c, test) <= 0
&& __collcmp(test, c2) <= 0
)
ok = 1;
} else if (c == test)
ok = 1;

View File

@ -45,6 +45,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#include <fnmatch.h>
#include <string.h>
#include "collate.h"
#define EOS '\0'
@ -162,7 +163,9 @@ rangematch(pattern, test, flags)
c2 = *pattern++;
if (c2 == EOS)
return (NULL);
if (c <= test && test <= c2)
if ( __collcmp(c, test) <= 0
&& __collcmp(test, c2) <= 0
)
ok = 1;
} else if (c == test)
ok = 1;