1.1 --- a/scanner.c Thu Jan 26 15:55:52 2012 +0100 1.2 +++ b/scanner.c Thu Feb 02 14:17:35 2012 +0100 1.3 @@ -77,9 +77,14 @@ 1.4 1.5 bfile = bfile_check(settings->bfileHeuristics, a); 1.6 1.7 - if (a == 10) { 1.8 + if (a == 10 || a == EOF) { 1.9 line_buffer[line_buffer_offset] = 0; 1.10 - /* TODO: do regex parsing */ 1.11 + if (regex_parser_do(settings->regex, line_buffer) == 0) { 1.12 + /* Only subtract lines when matching has finished */ 1.13 + if (!regex_parser_matching(settings->regex)) { 1.14 + lines -= settings->regex->matched_lines; 1.15 + } 1.16 + } 1.17 1.18 line_buffer_offset = 0; 1.19 lines++;