Changeset 285 for trunk/src


Ignore:
Timestamp:
May 11, 2010, 8:22:06 PM (14 years ago)
Author:
katerina
Message:

Fix for ticket #209 (check for pcre_dfa_exec).

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_log_correlate.c

    r272 r285  
    271271               * array, otherwise number of matches is not returned.
    272272               */
     273#if defined(HAVE_PCRE_DFA_EXEC)
    273274              int ovector[SH_MINIBUF];
    274275              int wspace[SH_MINIBUF];
     276#endif
     277
     278#if defined(HAVE_PCRE_DFA_EXEC)
    275279              int val = pcre_dfa_exec(mkeep->rule, NULL,
    276280                                      sh_string_str(res),
     
    280284                                      ovector, SH_MINIBUF,
    281285                                      wspace, SH_MINIBUF);
     286#else
     287              int val = pcre_exec(mkeep->rule, NULL,
     288                                  sh_string_str(res),
     289                                  (int)sh_string_len(res),
     290                                  0, /* start at offset 0 in the subject */
     291                                  0,
     292                                  NULL, 0);
     293              val = (val >= 0) ? 1 : val;                             
     294#endif
     295
    282296              if (val >= 0)
    283297                {
  • trunk/src/sh_log_evalrule.c

    r276 r285  
    10341034    mmm = replace_captures(record->message, rule->ovector,
    10351035                           rule->ovecnum);
     1036    rule->ovecnum = 0;
    10361037    msg = sh_util_safe_name_keepspace (sh_string_str(mmm));
    10371038  }
     
    11331134 */
    11341135static int  process_counter(struct sh_ceval * counter,
    1135                             struct sh_geval * rule,  struct sh_logrecord * record)
     1136                            struct sh_geval * rule, 
     1137                            struct sh_logrecord * record)
    11361138{
    11371139  int retval = -1;
     
    11421144      counter->counted_str = replace_captures(record->message, rule->ovector,
    11431145                                              rule->ovecnum);
     1146      rule->ovecnum        = 0;
    11441147      counter->filename    = sh_string_new_from_lchar(record->filename,
    11451148                                                      strlen(record->filename));
Note: See TracChangeset for help on using the changeset viewer.