const char **result_r ATTR_UNUSED,
const char **error_r)
{
- if (strcmp(key, "notfound") == 0) return 0;
+ if (strcmp(key, "notfound") == 0) {
+ *error_r = "Invalid field";
+ return 0;
+ }
*error_r = "Bad parameters";
return -1;
}
array_foreach(&var_expand_extensions, f) {
/* ensure we won't match abbreviations */
size_t len = sep-key;
- if (strncasecmp(key, f->key, len) == 0 && f->key[len] == '\0')
- return f->func(ctx, key, data, var_r, error_r);
+ if (strncasecmp(key, f->key, len) == 0 && f->key[len] == '\0') {
+ ret = f->func(ctx, key, data, var_r, error_r);
+ i_assert(ret == 1 || *error_r != NULL);
+ return ret;
+ }
}
if ((ret = var_expand_func(ctx->func_table, key, data,
ctx->context, var_r, error_r)) == 0) {