X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Frecgrs.c;h=da1ad6058b0dc5f62445025fc24da13982447939;hb=25cf3bc85f9df25a4fc36707cc80a77fe6f35c83;hp=df538ce10fa8a01c743ea1e24518c6d53a53376c;hpb=9be04e6cf1e848fcc4f065a7407e489684aaaf61;p=idzebra-moved-to-github.git diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index df538ce..da1ad60 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -1,4 +1,4 @@ -/* $Id: recgrs.c,v 1.107 2006-02-06 23:22:29 adam Exp $ +/* $Id: recgrs.c,v 1.108 2006-02-07 00:17:44 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -350,6 +350,7 @@ static int dfa_match_first(struct DFA_state **dfaar, const char *text) unsigned char c; for (c = *p++, t = s->trans, i = s->tran_no; --i >= 0; t++) + { if (c >= t->ch[0] && c <= t->ch[1]) { while (i >= 0) @@ -359,12 +360,15 @@ static int dfa_match_first(struct DFA_state **dfaar, const char *text) if (s->rule_no) return 1; /* next char */ + if (!c) + return 0; c = *p++; for (t = s->trans, i = s->tran_no; --i >= 0; t++) if (c >= t->ch[0] && c <= t->ch[1]) break; } } + } return 0; }