Ad Widget

Collapse

BUGFIX: Regular expressionas and new lines

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skogan
    Member
    • Nov 2007
    • 70

    #1

    BUGFIX: Regular expressionas and new lines

    This patch fixes the bug where zabbix's regexes are compiled with the REG_NEWLINE flag, causing new line character not to be treated as normal character. This is extremely counterintuitive for we scenarios and generally just plain useless.
    Code:
    --- zabbix-1.4.4.orig/src/libs/zbxcommon/regexp.c       2007-12-17 13:18:59.000000000 +0000
    +++ zabbix-1.4.4/src/libs/zbxcommon/regexp.c    2007-12-20 21:55:00.000000000 +0000
    @@ -51,10 +51,10 @@
    
     char   *zbx_regexp_match(const char *string, const char *pattern, int *len)
     {
    -       return zbx_regexp(string, pattern, len, REG_EXTENDED | REG_NEWLINE);
    +       return zbx_regexp(string, pattern, len, REG_EXTENDED);
     }
    
     char   *zbx_iregexp_match(const char *string, const char *pattern, int *len)
     {
    -       return zbx_regexp(string, pattern, len, REG_EXTENDED | REG_ICASE | REG_NEWLINE);
    +       return zbx_regexp(string, pattern, len, REG_EXTENDED | REG_ICASE);
     }
Working...