X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=dfa%2Fdfa.c;h=072c39700919854db1a1cb7c641894c785ff1a8b;hb=4247c4670f5bc5ad61e458734a590d57be5a9f34;hp=7b14ec6b7a1d84e579af259e37b1af9e55ad893e;hpb=d6a9b756bbc67a138ecea66eff5391e0c8947ac2;p=idzebra-moved-to-github.git diff --git a/dfa/dfa.c b/dfa/dfa.c index 7b14ec6..072c397 100644 --- a/dfa/dfa.c +++ b/dfa/dfa.c @@ -1,10 +1,19 @@ /* - * Copyright (C) 1994-1997, Index Data I/S + * Copyright (C) 1994-1998, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: dfa.c,v $ - * Revision 1.18 1997-09-29 09:05:17 adam + * Revision 1.21 1998-06-22 11:33:39 adam + * Added two type casts. + * + * Revision 1.20 1998/06/08 14:40:44 adam + * Fixed problem with signed character(s) in regular expressions. + * + * Revision 1.19 1998/01/12 14:39:39 adam + * Fixed bug in term_Tnode. + * + * Revision 1.18 1997/09/29 09:05:17 adam * Thread safe DFA module. We simply had to put a few static vars to * the DFA_parse structure. * @@ -481,7 +490,7 @@ static int map_l_char (struct DFA_parse *parse_info) if (cp0[0] == 1 && cp0[1]) { parse_info->expr_ptr++; - parse_info->look_ch = cp0[1]; + parse_info->look_ch = ((unsigned char *) cp0)[1]; return L_CHAR; } if (!parse_info->cmap) @@ -491,7 +500,7 @@ static int map_l_char (struct DFA_parse *parse_info) assert (mapto); parse_info->expr_ptr = (const unsigned char *) cp0; - parse_info->look_ch = mapto[i][0]; + parse_info->look_ch = ((unsigned char **) mapto)[i][0]; logf (LOG_DEBUG, "map from %c to %d", parse_info->expr_ptr[-1], parse_info->look_ch); return L_CHAR; } @@ -534,7 +543,7 @@ static const char *str_char (unsigned c) { static char s[6]; s[0] = '\\'; - if (c < 32) + if (c < 32 || c >= 127) switch (c) { case '\r': @@ -1059,6 +1068,7 @@ static struct DFA_parse *dfa_parse_init (void) add_BSet (parse_info->charset, parse_info->anyset, '\n'); com_BSet (parse_info->charset, parse_info->anyset); parse_info->use_Tnode = parse_info->max_Tnode = 0; + parse_info->start = parse_info->end = NULL; parse_info->charMap = NULL; parse_info->charMapSize = 0; parse_info->cmap = NULL;