diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2006-01-31 21:55:41 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2006-01-31 21:55:41 (GMT) |
commit | 1ed524b2b0f76d43e66c68835ea8c647a0a8beab (patch) | |
tree | 861fc45d09089887dc4c8cdb5067f563224cbda1 | |
parent | da398dd788268e57c19358540d45815a56f39091 (diff) | |
download | powwow-1ed524b2b0f76d43e66c68835ea8c647a0a8beab.zip powwow-1ed524b2b0f76d43e66c68835ea8c647a0a8beab.tar.gz powwow-1ed524b2b0f76d43e66c68835ea8c647a0a8beab.tar.bz2 |
1. Allows empty-line matching using regexp.
E.g.: gagging of all empty lines
#action %empty ^$=
2. Fixes the bug in parameter copy for regexp actions.
powwow did not set any matched regex params after finding an empty match
(Elestir)
-rw-r--r-- | main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -811,7 +811,7 @@ static void process_singleline __P2 (char **,pbuf, int *,psize) size = len; } } - if (!len && (!*linestart || (!search_action(linestart, 0) || opt_autoprint))) { + if (!len && ((!search_action(linestart, 0) || opt_autoprint))) { if (line0 < lines - 1) line0++; if (tcp_fd != tcp_main_fd) /* sub connection */ @@ -1104,7 +1104,8 @@ static int match_regexp_action __P4 (void *,regexp, char *,line, int *,match_s, for (n = 1; n < NUMPARAM; n++) match_s[n] = match_e[n] = 0; for (n = 0; n <= (int)((regex_t *)regexp)->re_nsub && - reg_match[n].rm_so != -1 && n < NUMPARAM - 1; n++) { + n < NUMPARAM - 1; n++) { + if (reg_match[n].rm_so == -1) continue; match_s[n+1] = reg_match[n].rm_so; match_e[n+1] = reg_match[n].rm_eo; } |