We should never change the list passed to rc_config_value.
This commit is contained in:
parent
87f785cc31
commit
773c2b9ca6
@ -243,9 +243,9 @@ char **rc_config_load (const char *file)
|
|||||||
}
|
}
|
||||||
librc_hidden_def(rc_config_load)
|
librc_hidden_def(rc_config_load)
|
||||||
|
|
||||||
char *rc_config_value (char **list, const char *entry)
|
char *rc_config_value (const char *const *list, const char *entry)
|
||||||
{
|
{
|
||||||
char *line;
|
const char *line;
|
||||||
int i;
|
int i;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ char **rc_config_list (const char *file);
|
|||||||
char **rc_config_load (const char *file);
|
char **rc_config_load (const char *file);
|
||||||
|
|
||||||
/*! Return the value of the entry from a key=value list. */
|
/*! Return the value of the entry from a key=value list. */
|
||||||
char *rc_config_value (char **list, const char *entry);
|
char *rc_config_value (const char *const *list, const char *entry);
|
||||||
|
|
||||||
/*! Check if a variable is a boolean and return it's value.
|
/*! Check if a variable is a boolean and return it's value.
|
||||||
* If variable is not a boolean then we set errno to be ENOENT when it does
|
* If variable is not a boolean then we set errno to be ENOENT when it does
|
||||||
|
@ -89,7 +89,7 @@ char *rc_conf_value (const char *setting)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (rc_config_value (rc_conf, setting));
|
return (rc_config_value ((const char *const *)rc_conf, setting));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rc_conf_yesno (const char *setting)
|
bool rc_conf_yesno (const char *setting)
|
||||||
@ -176,7 +176,7 @@ char **env_filter (void)
|
|||||||
env_len = strlen (env_name) + strlen ("export ") + 1;
|
env_len = strlen (env_name) + strlen ("export ") + 1;
|
||||||
p = xmalloc (sizeof (char) * env_len);
|
p = xmalloc (sizeof (char) * env_len);
|
||||||
snprintf (p, env_len, "export %s", env_name);
|
snprintf (p, env_len, "export %s", env_name);
|
||||||
env_var = rc_config_value (profile, p);
|
env_var = rc_config_value ((const char *const *) profile, p);
|
||||||
free (p);
|
free (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user