X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fregxread.c;h=c54e12a2a2055bfc2884ba791a049a635a08b140;hb=e075935572b3ef0a246aaefde50efadbfa12e5c4;hp=3d074a8eb303e0a76e29b65f3db5555e20ce87ba;hpb=8add234f71c852fd95ca3aef168e3563265c93b9;p=idzebra-moved-to-github.git diff --git a/recctrl/regxread.c b/recctrl/regxread.c index 3d074a8..c54e12a 100644 --- a/recctrl/regxread.c +++ b/recctrl/regxread.c @@ -1,4 +1,4 @@ -/* $Id: regxread.c,v 1.57 2005-01-16 23:14:57 adam Exp $ +/* $Id: regxread.c,v 1.62 2006-06-13 19:45:14 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include +#include #include #include @@ -469,15 +469,20 @@ static int actionListMk (struct lexSpec *spec, const char *s, r = dfa_parse ((*ap)->u.pattern.dfa, &s); if (r || *s != '/') { + int pos = s - s0; xfree (*ap); *ap = NULL; - yaz_log (YLOG_WARN, "regular expression error '%.*s'", s-s0, s0); + yaz_log(YLOG_WARN, "regular expression error '%.*s'", pos, s0); return -1; } - if (debug_dfa_tran) - printf ("pattern: %.*s\n", s-s0, s0); - dfa_mkstate ((*ap)->u.pattern.dfa); - s++; + else + { + int pos = s - s0; + if (debug_dfa_tran) + printf("pattern: %.*s\n", pos, s0); + dfa_mkstate((*ap)->u.pattern.dfa); + s++; + } break; case REGX_BEGIN: yaz_log (YLOG_WARN, "cannot use BEGIN here"); @@ -1866,11 +1871,12 @@ void *grs_init(Res res, RecType recType) } -void grs_config(void *clientData, Res res, const char *args) +ZEBRA_RES grs_config(void *clientData, Res res, const char *args) { struct lexSpecs *specs = (struct lexSpecs *) clientData; if (strlen(args) < sizeof(specs->type)) strcpy(specs->type, args); + return ZEBRA_OK; } data1_node *grs_read_regx (struct grs_read_info *p) @@ -1920,6 +1926,7 @@ static int retrieve_regx(void *clientData, struct recRetrieveCtrl *ctrl) } static struct recType regx_type = { + 0, "grs.regx", grs_init, grs_config, @@ -1986,6 +1993,7 @@ static int retrieve_tcl(void *clientData, struct recRetrieveCtrl *ctrl) } static struct recType tcl_type = { + 0, "grs.tcl", grs_init, grs_config, @@ -2010,3 +2018,11 @@ idzebra_filter #endif 0, }; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +