46 } |
46 } |
47 |
47 |
48 ConfigParser2 parser; |
48 ConfigParser2 parser; |
49 memset(&parser, 0, sizeof(ConfigParser2)); |
49 memset(&parser, 0, sizeof(ConfigParser2)); |
50 parser.mp = mp; |
50 parser.mp = mp; |
|
51 parser.filename = file; |
51 parser.allow_hierarchy = true; |
52 parser.allow_hierarchy = true; |
52 parser.delim = ""; |
53 parser.delim = ""; |
53 ConfigNode *root = serverconfig_load_file(&parser, file); |
54 ConfigNode *root = serverconfig_load_file(&parser, file); |
54 if(!root) { |
55 if(!root) { |
55 cxMempoolDestroy(mp); |
56 cxMempoolDestroy(mp); |
124 for(i=start;i<content.length;i++) { |
125 for(i=start;i<content.length;i++) { |
125 char c = content.ptr[i]; |
126 char c = content.ptr[i]; |
126 if(c == '\n') { |
127 if(c == '\n') { |
127 if(quote) { |
128 if(quote) { |
128 *pos = i; |
129 *pos = i; |
|
130 log_ereport( |
|
131 LOG_FAILURE, |
|
132 "cfgparser: file %s:%d:%d: error: %s", |
|
133 parser->filename, |
|
134 parser->linenum, |
|
135 parser->linepos+2, |
|
136 "missing '\"' character before end of line"); |
129 return token; // error |
137 return token; // error |
130 } else if(start == i) { |
138 } else if(start == i) { |
131 // single newline char token |
139 // single newline char token |
132 type = CFG_TOKEN_NEWLINE; |
140 type = CFG_TOKEN_NEWLINE; |
133 token_begin = i; |
141 token_begin = i; |
134 token_end = i+1; |
142 token_end = i+1; |
|
143 parser->linenum++; |
|
144 parser->linepos = 0; |
135 break; |
145 break; |
136 } |
146 } |
137 |
147 |
138 token_end = i; |
148 token_end = i; |
139 if(token_begin < 0) { |
149 if(token_begin < 0) { |