From efcc77ba70a6a72a0b400ca85510d4869166c1a2 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sun, 20 Oct 1996 16:54:51 +0000 Subject: [PATCH] Better case insensitve search support for pattern with meta chars. In some rare cases this does not work proper before flag FNM_ICASE was added to fnmatch(3). --- usr.bin/locate/locate/fastfind.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index c175c184973..dd95287f279 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: fastfind.c,v 1.2 1996/10/09 00:33:32 wosch Exp $ + * $Id: fastfind.c,v 1.3 1996/10/13 01:44:34 wosch Exp $ */ @@ -300,7 +300,14 @@ fastfind break; if (*p == '\0') { /* fast match success */ found = 1; - if (!globflag || !fnmatch(pathpart, path, 0)) { + if (!globflag || +#ifndef FF_ICASE + !fnmatch(pathpart, path, 0)) +#else + !fnmatch(pathpart, path, + FNM_ICASE)) +#endif /* !FF_ICASE */ + { if (f_silent) counter++; else if (f_limit) {