scanner.c

changeset 28
72a98cbcb9f1
parent 27
95a958e3de88
child 30
d642fdb6745e
--- a/scanner.c	Thu Jan 26 15:55:52 2012 +0100
+++ b/scanner.c	Thu Feb 02 14:17:35 2012 +0100
@@ -77,9 +77,14 @@
 
           bfile = bfile_check(settings->bfileHeuristics, a);
 
-          if (a == 10) {
+          if (a == 10 || a == EOF) {
             line_buffer[line_buffer_offset] = 0;
-            /* TODO: do regex parsing */
+            if (regex_parser_do(settings->regex, line_buffer) == 0) {
+              /* Only subtract lines when matching has finished */
+              if (!regex_parser_matching(settings->regex)) {
+                lines -= settings->regex->matched_lines;
+              }
+            }
 
             line_buffer_offset = 0;
             lines++;

mercurial