static const char * ap_build_config_sub(apr_pool_t *p, apr_pool_t *temp_pool,
const char *l, cmd_parms *parms,
ap_directive_t **current,
- ap_directive_t **curr_parent)
+ ap_directive_t **curr_parent,
+ ap_directive_t **conftree)
{
const char *args;
char *cmd_name;
}
}
if (*current) {
+ if (!*conftree) {
+ /* Before walking *current to the end of the list,
+ * set the head to *current.
+ */
+ *conftree = *current;
+ }
while ((*current)->next != NULL) {
(*current) = (*current)->next;
(*current)->parent = (*curr_parent);
break;
}
retval = ap_build_config_sub(p, temp_pool, l, parms, current,
- curr_parent);
+ curr_parent, &conftree);
if (retval != NULL)
return retval;
if (conftree == NULL && curr_parent != NULL) {
while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) {
errmsg = ap_build_config_sub(p, temp_pool, l, parms,
- ¤t, &curr_parent);
+ ¤t, &curr_parent, conftree);
if (errmsg != NULL)
return errmsg;