75 do { |
75 do { |
76 a = fgetc(file); |
76 a = fgetc(file); |
77 |
77 |
78 bfile = bfile_check(settings->bfileHeuristics, a); |
78 bfile = bfile_check(settings->bfileHeuristics, a); |
79 |
79 |
80 if (a == 10) { |
80 if (a == 10 || a == EOF) { |
81 line_buffer[line_buffer_offset] = 0; |
81 line_buffer[line_buffer_offset] = 0; |
82 /* TODO: do regex parsing */ |
82 if (regex_parser_do(settings->regex, line_buffer) == 0) { |
|
83 /* Only subtract lines when matching has finished */ |
|
84 if (!regex_parser_matching(settings->regex)) { |
|
85 lines -= settings->regex->matched_lines; |
|
86 } |
|
87 } |
83 |
88 |
84 line_buffer_offset = 0; |
89 line_buffer_offset = 0; |
85 lines++; |
90 lines++; |
86 } else { |
91 } else { |
87 if (line_buffer_offset < REGEX_MAX_LINELENGTH) { |
92 if (line_buffer_offset < REGEX_MAX_LINELENGTH) { |