scanner.c

changeset 27
95a958e3de88
parent 25
802c5382f499
child 28
72a98cbcb9f1
     1.1 --- a/scanner.c	Thu Dec 01 17:06:27 2011 +0100
     1.2 +++ b/scanner.c	Thu Jan 26 15:55:52 2012 +0100
     1.3 @@ -9,6 +9,7 @@
     1.4  #include "scanner.h"
     1.5  #include "suffix_fnc.h"
     1.6  #include "bfile_heuristics.h"
     1.7 +#include "regex_parser.h"
     1.8  #include <sys/stat.h>
     1.9  
    1.10  int scanDirectory(scanner_t scanner, settings_t* settings) {
    1.11 @@ -61,7 +62,7 @@
    1.12          lines = 0;
    1.13          bfile = false;
    1.14          bfile_reset(settings->bfileHeuristics);
    1.15 -        char line_buffer[2048];
    1.16 +        char line_buffer[REGEX_MAX_LINELENGTH];
    1.17          int line_buffer_offset = 0;
    1.18  
    1.19          FILE *file = fopen(filename, "r");
    1.20 @@ -83,7 +84,7 @@
    1.21              line_buffer_offset = 0;
    1.22              lines++;
    1.23            } else {
    1.24 -            if (line_buffer_offset < 2048) {
    1.25 +            if (line_buffer_offset < REGEX_MAX_LINELENGTH) {
    1.26                line_buffer[line_buffer_offset] = a;
    1.27                line_buffer_offset++;
    1.28              } else {

mercurial