131 |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE)" |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE)" |
132 |
"[[:blank:]]*=[[:blank:]]*([[:print:]]+)\n$", |
"[[:blank:]]*=[[:blank:]]*([[:print:]]+)\n$", |
133 |
|
|
134 |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(HEADERS|NAMESPACE|EXPUNGE)" |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(EXPUNGE|HEADERS|NAMESPACE|" |
135 |
"[[:blank:]]*=[[:blank:]]*(YES|NO)[[:blank:]]*\n$", |
"SUBSCRIBE)[[:blank:]]*=[[:blank:]]*(YES|NO)[[:blank:]]*\n$", |
136 |
|
|
137 |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)" |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)" |
138 |
"[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$" |
"[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$" |
185 |
*/ |
*/ |
186 |
void set_options(char *line, regmatch_t * match) |
void set_options(char *line, regmatch_t * match) |
187 |
{ |
{ |
188 |
if (!strncasecmp(line + match[2].rm_so, "logfile", 7)) { |
if (!strcasecmp(line + match[2].rm_so, "logfile")) { |
189 |
if (!*logfile) |
if (!*logfile) |
190 |
strncat(logfile, line + match[3].rm_so, |
strncat(logfile, line + match[3].rm_so, |
191 |
min((match[3].rm_eo - match[3].rm_so), PATH_MAX - 1)); |
min((match[3].rm_eo - match[3].rm_so), PATH_MAX - 1)); |
192 |
} else if (!strncasecmp(line + match[2].rm_so, "header", 6)) { |
} else if (!strcasecmp(line + match[2].rm_so, "expunge")) { |
193 |
if (!strncasecmp(line + match[3].rm_so, "yes", 3)) |
if (!strcasecmp(line + match[3].rm_so, "yes")) |
194 |
|
options |= OPTION_EXPUNGE; |
195 |
|
else |
196 |
|
options &= ~(OPTION_EXPUNGE); |
197 |
|
} else if (!strcasecmp(line + match[2].rm_so, "header")) { |
198 |
|
if (!strcasecmp(line + match[3].rm_so, "yes")) |
199 |
options |= OPTION_HEADERS; |
options |= OPTION_HEADERS; |
200 |
else |
else |
201 |
options &= ~(OPTION_HEADERS); |
options &= ~(OPTION_HEADERS); |
202 |
} else if (!strncasecmp(line + match[2].rm_so, "namespace", 9)) { |
} else if (!strcasecmp(line + match[2].rm_so, "namespace")) { |
203 |
if (!strncasecmp(line + match[3].rm_so, "yes", 3)) |
if (!strcasecmp(line + match[3].rm_so, "yes")) |
204 |
options |= OPTION_NAMESPACE; |
options |= OPTION_NAMESPACE; |
205 |
else |
else |
206 |
options &= ~(OPTION_NAMESPACE); |
options &= ~(OPTION_NAMESPACE); |
207 |
} else if (!strncasecmp(line + match[2].rm_so, "expunge", 7)) { |
} else if (!strcasecmp(line + match[2].rm_so, "subscribe")) { |
208 |
if (!strncasecmp(line + match[3].rm_so, "yes", 3)) |
if (!strcasecmp(line + match[2].rm_so, "yes")) |
209 |
options |= OPTION_EXPUNGE; |
options |= OPTION_SUBSCRIBE; |
210 |
else |
else |
211 |
options &= ~(OPTION_EXPUNGE); |
options &= ~(OPTION_SUBSCRIBE); |
212 |
} else if (!strncasecmp(line + match[2].rm_so, "timeout", 7)) { |
} else if (!strcasecmp(line + match[2].rm_so, "timeout")) { |
213 |
errno = 0; |
errno = 0; |
214 |
timeout = strtol(line + match[3].rm_so, NULL, 10); |
timeout = strtol(line + match[3].rm_so, NULL, 10); |
215 |
if (errno) |
if (errno) |
216 |
timeout = 0; |
timeout = 0; |
217 |
} else if (!strncasecmp(line + match[2].rm_so, "daemon", 6) && |
} else if (!strcasecmp(line + match[2].rm_so, "daemon") && |
218 |
!(options & OPTION_DAEMON_MODE)) { |
!(options & OPTION_DAEMON_MODE)) { |
219 |
options |= OPTION_DAEMON_MODE; |
options |= OPTION_DAEMON_MODE; |
220 |
errno = 0; |
errno = 0; |