24 |
int r; |
int r; |
25 |
FILE *fp; |
FILE *fp; |
26 |
char *home = NULL; |
char *home = NULL; |
27 |
|
char *c = NULL; |
28 |
|
|
29 |
if (!cfg) { |
if (!cfg) { |
30 |
cfg = (char *) xmalloc(PATH_MAX * sizeof(char)); |
cfg = c = (char *) xmalloc(PATH_MAX * sizeof(char)); |
31 |
|
|
32 |
home = getenv("HOME"); |
home = getenv("HOME"); |
33 |
|
|
45 |
fatal(ERROR_FILE_OPEN, "imapfilter: opening config file %s; %s\n", |
fatal(ERROR_FILE_OPEN, "imapfilter: opening config file %s; %s\n", |
46 |
cfg, strerror(errno)); |
cfg, strerror(errno)); |
47 |
|
|
48 |
|
if (c) |
49 |
|
free(c); |
50 |
|
|
51 |
if ((r = parse_config(fp))) |
if ((r = parse_config(fp))) |
52 |
fatal(ERROR_CONFIG_PARSE, |
fatal(ERROR_CONFIG_PARSE, |
53 |
"imapfilter: parse error in config file at row %d\n", r); |
"imapfilter: parse error in config file at row %d\n", r); |
54 |
|
|
55 |
fclose(fp); |
fclose(fp); |
|
|
|
|
if (!cfg) |
|
|
free(cfg); |
|
56 |
|
|
57 |
#ifdef DEBUG |
#ifdef DEBUG |
58 |
printf("debug: options: %0#10x\n", options); |
printf("debug: options: %0#10x\n", options); |