If `lint' macro isn't defined, kwset.c is warned to be uninitialized
with -Wall.  Of course, even if it's warned, there is no operational
problems.  However, I can't find any reasons that `accept' variable
should be uninitialized.  So fix it.

Norihiro
From 97d42eacfe9d6682f90fbf6e2223e30413462a8a Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email protected]>
Date: Fri, 25 Apr 2014 07:49:46 +0900
Subject: [PATCH] grep: warning to be uninitialized with -Wall

* src/kwset.c (cwexec): Fix it.
---
 src/kwset.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/kwset.c b/src/kwset.c
index f86ee03..11628c3 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -630,16 +630,13 @@ cwexec (kwset_t kwset, char const *text, size_t len, 
struct kwsmatch *kwsmatch)
   struct tree const *tree;
   char const *trans;
 
-#ifdef lint
-  accept = NULL;
-#endif
-
   /* Initialize register copies and look for easy ways out. */
   if (len < kwset->mind)
     return -1;
   next = kwset->next;
   delta = kwset->delta;
   trans = kwset->trans;
+  accept = NULL;
   lim = text + len;
   end = text;
   if ((d = kwset->mind) != 0)
-- 
1.9.2

Reply via email to