From 36a00a4b79dcbbdeffd85f82930c2f3227a19a18 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 12 Aug 1996 04:03:50 +0000 Subject: [PATCH] Use collate for alpha character ranges --- lib/libc/gen/fnmatch.c | 5 ++++- sys/libkern/fnmatch.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index 96cd341f14d..3005184e336 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #include #include +#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; diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c index 96cd341f14d..3005184e336 100644 --- a/sys/libkern/fnmatch.c +++ b/sys/libkern/fnmatch.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #include #include +#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;