|
|
|
@ -9,7 +9,7 @@ CFGFileParser::CFGFileParser(const char* filename){
@@ -9,7 +9,7 @@ CFGFileParser::CFGFileParser(const char* filename){
|
|
|
|
|
// the buffer, close the file
|
|
|
|
|
cfg_file = fopen(filename, "rb"); // On NT, opening in text mode translates \n into \r\n
|
|
|
|
|
stat(filename, cfg_fileinfo); |
|
|
|
|
buffer = static_cast<char*>(tlsf_calloc(cfg_fileinfo->st_size & INT_MAX, sizeof(char) & INT_MAX)); |
|
|
|
|
buffer = static_cast<char*>(tlsf_malloc(cfg_fileinfo->st_size & INT_MAX, sizeof(char) & INT_MAX)); |
|
|
|
|
cfg = new BrowserConfiguration(); |
|
|
|
|
bytesRead = fread(buffer, sizeof(char) & INT_MAX, cfg_fileinfo->st_size & INT_MAX, cfg_file); |
|
|
|
|
if (!bytesRead) { |
|
|
|
@ -39,7 +39,7 @@ bool CFGFileParser::ParseText() {
@@ -39,7 +39,7 @@ bool CFGFileParser::ParseText() {
|
|
|
|
|
size_t pass1_length = 0; |
|
|
|
|
struct slre regex; // final validation before adding to second-pass buffer
|
|
|
|
|
// Second pass. All comments and .tags stripped out. Starts off at 512 bytes, increases if necessary.
|
|
|
|
|
char* directives = static_cast<char*>(tlsf_calloc(512, sizeof(char))); |
|
|
|
|
char* directives = static_cast<char*>(tlsf_malloc(512, sizeof(char))); |
|
|
|
|
char* tmp2; |
|
|
|
|
token = strtok_r(buffer, "\n", &tmp); |
|
|
|
|
while (tmp != nullptr) { |
|
|
|
|