* Sebastian Hammer, Adam Dickmeiss
*
* $Log: regxread.c,v $
- * Revision 1.12 1997-11-18 10:03:24 adam
+ * Revision 1.13 1997-12-12 06:33:58 adam
+ * Fixed bug that showed up when multiple filter where used.
+ * Made one routine thread-safe.
+ *
+ * Revision 1.12 1997/11/18 10:03:24 adam
* Member num_children removed from data1_node.
*
* Revision 1.11 1997/11/06 11:41:01 adam
xfree (p->trans.fastRule);
for (rp = p->trans.rules; rp; rp = rp1)
{
+ rp1 = rp->next;
actionListDel (&rp->info.actionList);
xfree (rp);
}
res = data1_mk_node (spec->dh, spec->m);
res->parent = parent;
res->which = DATA1N_tag;
- res->u.tag.tag = res->lbuf;
res->u.tag.get_bytes = -1;
if (len >= DATA1_LOCALDATA)
len = DATA1_LOCALDATA-1;
-
- memcpy (res->u.tag.tag, tag, len);
- res->u.tag.tag[len] = '\0';
+ memcpy (res->lbuf, tag, len);
+ res->lbuf[len] = '\0';
+ res->u.tag.tag = res->lbuf;
#if REGX_DEBUG
logf (LOG_DEBUG, "tag begin %s (%d)", res->u.tag.tag, *d1_level);
return 2;
}
-static char *regxStrz (const char *src, int len)
+static char *regxStrz (const char *src, int len, char *str)
{
- static char str[64];
-
if (len > 63)
len = 63;
memcpy (str, src, len);
r = execTok (spec, &s, arg_no, arg_start, arg_end, &cmd_str, &cmd_len);
while (r)
{
- char *p;
+ char *p, ptmp[64];
if (r == 1)
{
&cmd_str, &cmd_len);
continue;
}
- p = regxStrz (cmd_str, cmd_len);
+ p = regxStrz (cmd_str, cmd_len, ptmp);
if (!strcmp (p, "begin"))
{
r = execTok (spec, &s, arg_no, arg_start, arg_end,
&cmd_str, &cmd_len);
if (r < 2)
continue;
- p = regxStrz (cmd_str, cmd_len);
+ p = regxStrz (cmd_str, cmd_len, ptmp);
if (!strcmp (p, "record"))
{
r = execTok (spec, &s, arg_no, arg_start, arg_end,
&cmd_str, &cmd_len);
if (r > 1)
{
- p = regxStrz (cmd_str, cmd_len);
+ p = regxStrz (cmd_str, cmd_len, ptmp);
if (!strcmp (p, "record"))
{
*d1_level = 0;
logf (LOG_WARN, "missing number after -offset");
continue;
}
- p = regxStrz (cmd_str, cmd_len);
+ p = regxStrz (cmd_str, cmd_len, ptmp);
offset = atoi (p);
r = execTok (spec, &s, arg_no, arg_start, arg_end,
&cmd_str, &cmd_len);
data1_node *grs_read_regx (struct grs_read_info *p)
{
int res;
- data1_node *n;
#if REGX_DEBUG
logf (LOG_DEBUG, "grs_read_regx");
curLexSpec->f_win_size = 500000;
}
curLexSpec->m = p->mem;
- n = lexRoot (curLexSpec, p->offset);
- return n;
+ return lexRoot (curLexSpec, p->offset);
}