$NetBSD: patch-ae,v 1.4 2005/12/18 14:27:01 joerg Exp $

--- util.c.orig	2004-01-02 15:00:34.000000000 +0000
+++ util.c
@@ -36,6 +36,7 @@
 #include <sys/stat.h>
 
 #include <ctype.h>
+#include <zlib.h>
 #include <err.h>
 #include <errno.h>
 #include <fts.h>
@@ -44,7 +45,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <zlib.h>
 
 #include "grep.h"
 
@@ -99,7 +99,7 @@ grep_tree(char **argv)
 }
 
 int
-procfile(char *fn)
+procfile(const char *fn)
 {
 	str_t ln;
 	file_t *f;
@@ -228,8 +228,8 @@ procline(str_t *l, int nottext)
 				continue;
 			if (r == 0) {
 				if (wflag) {
-					if ((pmatch.rm_so != 0 && isword(l->dat[pmatch.rm_so - 1]))
-					    || (pmatch.rm_eo != l->len && isword(l->dat[pmatch.rm_eo])))
+					if ((pmatch.rm_so != 0 && isword((unsigned char)l->dat[pmatch.rm_so - 1]))
+					    || (pmatch.rm_eo != l->len && isword((unsigned char)l->dat[pmatch.rm_eo])))
 						r = REG_NOMATCH;
 				}
 				if (xflag) {
