|
|
@ -570,16 +570,13 @@ main(int argc, char *argv[]) {
|
|
|
|
const char *str;
|
|
|
|
const char *str;
|
|
|
|
char path[PATH_MAX];
|
|
|
|
char path[PATH_MAX];
|
|
|
|
struct passwd *pw = getpwuid(getuid());
|
|
|
|
struct passwd *pw = getpwuid(getuid());
|
|
|
|
|
|
|
|
config_t cfg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_init(&cfg);
|
|
|
|
i = strlen(pw->pw_dir);
|
|
|
|
i = strlen(pw->pw_dir);
|
|
|
|
strcpy(path, pw->pw_dir);
|
|
|
|
strcpy(path, pw->pw_dir);
|
|
|
|
strcpy(&path[i], CONFIG);
|
|
|
|
strcpy(&path[i], CONFIG);
|
|
|
|
|
|
|
|
|
|
|
|
config_t cfg;
|
|
|
|
|
|
|
|
config_setting_t *setting;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_init(&cfg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Read the file. If there is an error, report it and exit. */
|
|
|
|
/* Read the file. If there is an error, report it and exit. */
|
|
|
|
if (config_read_file(&cfg, path)) {
|
|
|
|
if (config_read_file(&cfg, path)) {
|
|
|
|
if (config_lookup_string(&cfg, "asterisk", &str)) {
|
|
|
|
if (config_lookup_string(&cfg, "asterisk", &str)) {
|
|
|
@ -627,7 +624,7 @@ main(int argc, char *argv[]) {
|
|
|
|
if (config_lookup_bool(&cfg, "embedded", &bval)) {
|
|
|
|
if (config_lookup_bool(&cfg, "embedded", &bval)) {
|
|
|
|
embedded = bval;
|
|
|
|
embedded = bval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (str = config_error_file(&cfg)) {
|
|
|
|
} else if ((str = config_error_file(&cfg))) {
|
|
|
|
fprintf(stderr, "%s:%d: %s\n", config_error_file(&cfg),
|
|
|
|
fprintf(stderr, "%s:%d: %s\n", config_error_file(&cfg),
|
|
|
|
config_error_line(&cfg), config_error_text(&cfg));
|
|
|
|
config_error_line(&cfg), config_error_text(&cfg));
|
|
|
|
return(EXIT_FAILURE);
|
|
|
|
return(EXIT_FAILURE);
|
|
|
|