59 if (testSuffix(filename, settings)) { |
60 if (testSuffix(filename, settings)) { |
60 /* Count lines */ |
61 /* Count lines */ |
61 lines = 0; |
62 lines = 0; |
62 bfile = false; |
63 bfile = false; |
63 bfile_reset(settings->bfileHeuristics); |
64 bfile_reset(settings->bfileHeuristics); |
64 char line_buffer[2048]; |
65 char line_buffer[REGEX_MAX_LINELENGTH]; |
65 int line_buffer_offset = 0; |
66 int line_buffer_offset = 0; |
66 |
67 |
67 FILE *file = fopen(filename, "r"); |
68 FILE *file = fopen(filename, "r"); |
68 if (file == NULL) { |
69 if (file == NULL) { |
69 printf(entryname); |
70 printf(entryname); |
81 /* TODO: do regex parsing */ |
82 /* TODO: do regex parsing */ |
82 |
83 |
83 line_buffer_offset = 0; |
84 line_buffer_offset = 0; |
84 lines++; |
85 lines++; |
85 } else { |
86 } else { |
86 if (line_buffer_offset < 2048) { |
87 if (line_buffer_offset < REGEX_MAX_LINELENGTH) { |
87 line_buffer[line_buffer_offset] = a; |
88 line_buffer[line_buffer_offset] = a; |
88 line_buffer_offset++; |
89 line_buffer_offset++; |
89 } else { |
90 } else { |
90 line_buffer[line_buffer_offset-1] = 0; |
91 line_buffer[line_buffer_offset-1] = 0; |
91 settings->confusing_lnlen = true; |
92 settings->confusing_lnlen = true; |