diff --git a/src/switch_xml.c b/src/switch_xml.c index b05358741c..94268da358 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -839,6 +839,8 @@ static short switch_xml_internal_dtd(switch_xml_root_t root, char *s, switch_siz if (!*s) break; else if (!strncmp(s, "ent; ent[i]; i++); + use_pe = (*c == '%'); + for (i = 0, ent = (use_pe) ? pe : root->ent; ent[i]; i++); sstmp = (char **) switch_must_realloc(ent, (i + 3) * sizeof(char *)); /* space for next ent */ ent = sstmp; - if (*c == '%') + if (use_pe) pe = ent; else root->ent = ent;