comparison cfgparser.c @ 1077:c433e62cb3de

fix again
author szabii
date Sat, 09 Jun 2001 17:41:31 +0000
parents a981413af7cd
children b2a29e1224e4
comparison
equal deleted inserted replaced
1076:52bbb0e913d8 1077:c433e62cb3de
27 #ifdef DEBUG 27 #ifdef DEBUG
28 #include <assert.h> 28 #include <assert.h>
29 #endif 29 #endif
30 30
31 #include "cfgparser.h" 31 #include "cfgparser.h"
32
33 extern int verbose;
34 32
35 static struct config *config; 33 static struct config *config;
36 static int nr_options; /* number of options in 'conf' */ 34 static int nr_options; /* number of options in 'conf' */
37 static int parser_mode; /* COMMAND_LINE or CONFIG_FILE */ 35 static int parser_mode; /* COMMAND_LINE or CONFIG_FILE */
38 static int recursion_depth = 0; 36 static int recursion_depth = 0;
251 printf("too deep 'include'. check your configfiles\n"); 249 printf("too deep 'include'. check your configfiles\n");
252 --recursion_depth; 250 --recursion_depth;
253 return -1; 251 return -1;
254 } 252 }
255 253
256 // printf("Reading config file: %s", conffile);
257
258 if (init_conf(conf, CONFIG_FILE) == -1) { 254 if (init_conf(conf, CONFIG_FILE) == -1) {
259 ret = -1; 255 ret = -1;
260 goto out; 256 goto out;
261 } 257 }
262 258
265 ret = -1; 261 ret = -1;
266 goto out; 262 goto out;
267 } 263 }
268 264
269 if ((fp = fopen(conffile, "r")) == NULL) { 265 if ((fp = fopen(conffile, "r")) == NULL) {
270 // printf(": %s\n", strerror(errno));
271 free(line); 266 free(line);
272 ret = 0; 267 ret = 0;
273 goto out; 268 goto out;
274 } 269 }
275 // printf("\n");
276 270
277 while (fgets(line, MAX_LINE_LEN, fp)) { 271 while (fgets(line, MAX_LINE_LEN, fp)) {
278 line_num++; 272 line_num++;
279 line_pos = 0; 273 line_pos = 0;
280 274