fr_sbuff_parse_rules_t const *p_rules,
tmpl_rules_t const *t_rules)
{
- int ret;
- size_t list_len;
- tmpl_t *vpt;
- fr_sbuff_t our_name = FR_SBUFF(name); /* Take a local copy in case we need to back track */
- bool ref_prefix = false;
- bool is_raw = false;
+ int ret;
+ size_t list_len;
+ tmpl_t *vpt;
+ fr_sbuff_t our_name = FR_SBUFF(name); /* Take a local copy in case we need to back track */
+ bool ref_prefix = false;
+ bool is_raw = false;
+ fr_sbuff_marker_t m_l;
if (!t_rules) t_rules = &default_attr_rules; /* Use the defaults */
FR_SBUFF_ERROR_RETURN(&our_name);
}
+ fr_sbuff_marker(&m_l, &our_name);
+
/*
* Parse the list reference
*
FR_SBUFF_ERROR_RETURN(&our_name);
}
+ /*
+ * Check if we need to backtrack
+ *
+ * Lists can be followed by a '.', '[', or the end of the attribute reference
+ *
+ * If we don't find any of those things it wasn't an actual list match
+ * but one of the list identifiers matched part of an attribute reference.
+ *
+ * i.e. reply with reply-message.
+ */
+ if ((list_len > 0) && !fr_sbuff_is_char(&our_name, '.') &&
+ !fr_sbuff_is_char(&our_name, '[') && !tmpl_substr_terminal_check(&our_name, p_rules)) {
+ fr_sbuff_set(&our_name, &m_l);
+ list_len = 0;
+ vpt->data.attribute.list = t_rules->list_def;
+ }
+
/*
* Parse the attribute reference
*