static bool str_array_contains(ARRAY_TYPE(const_string) *arr, const char *str)
{
- const char *const *p;
+ const char *p;
- array_foreach(arr, p) {
- if (strcmp(*p, str) == 0)
+ array_foreach_elem(arr, p) {
+ if (strcmp(p, str) == 0)
return TRUE;
}
return FALSE;
config_filter_parser_find(struct config_parser_context *ctx,
const struct config_filter *filter)
{
- struct config_filter_parser *const *parsers;
-
- array_foreach(&ctx->all_parsers, parsers) {
- struct config_filter_parser *parser = *parsers;
+ struct config_filter_parser *parser;
+ array_foreach_elem(&ctx->all_parsers, parser) {
if (config_filters_equal(&parser->filter, filter))
return parser;
}
/* flush output before writing errors */
o_stream_uncork(output);
- array_foreach(&ctx->errors, strings) {
- i_error("%s", *strings);
+ array_foreach_elem(&ctx->errors, str) {
+ i_error("%s", str);
ret = -1;
}
return ret;
bool hide_passwords)
{
static struct config_dump_human_context *ctx;
- const char *const *str;
+ const char *str;
size_t len;
bool dump_section = FALSE;
return -1;
len = strlen(setting_name_filter);
- array_foreach(&ctx->strings, str) {
- if (strncmp(*str, setting_name_filter, len) != 0)
+ array_foreach_elem(&ctx->strings, str) {
+ if (strncmp(str, setting_name_filter, len) != 0)
continue;
- if ((*str)[len] == '=') {
+ if (str[len] == '=') {
if (hide_key)
- printf("%s\n", *str + len+1);
+ printf("%s\n", str + len+1);
else {
printf("%s = %s\n", setting_name_filter,
- *str + len+1);
+ str + len+1);
}
dump_section = FALSE;
break;
- } else if ((*str)[len] == '/') {
+ } else if (str[len] == '/') {
dump_section = TRUE;
}
}