mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add a case-insensitive variant to config_line_find()
This commit is contained in:
@@ -82,6 +82,19 @@ config_line_find(const config_line_t *lines,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** As config_line_find(), but perform a case-insensitive comparison. */
|
||||
const config_line_t *
|
||||
config_line_find_case(const config_line_t *lines,
|
||||
const char *key)
|
||||
{
|
||||
const config_line_t *cl;
|
||||
for (cl = lines; cl; cl = cl->next) {
|
||||
if (!strcasecmp(cl->key, key))
|
||||
return cl;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Auxiliary function that does all the work of config_get_lines.
|
||||
* <b>recursion_level</b> is the count of how many nested %includes we have.
|
||||
* <b>opened_lst</b> will have a list of opened files if provided.
|
||||
|
||||
@@ -48,6 +48,8 @@ config_line_t *config_lines_dup_and_filter(const config_line_t *inp,
|
||||
const char *key);
|
||||
const config_line_t *config_line_find(const config_line_t *lines,
|
||||
const char *key);
|
||||
const config_line_t *config_line_find_case(const config_line_t *lines,
|
||||
const char *key);
|
||||
int config_lines_eq(config_line_t *a, config_line_t *b);
|
||||
int config_count_key(const config_line_t *a, const char *key);
|
||||
void config_free_lines_(config_line_t *front);
|
||||
|
||||
Reference in New Issue
Block a user