mirror of https://github.com/swig/swig
Fix incorrect xml escaping in base class name when base class is a template
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7362 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c061a4f160
commit
f74c045cca
|
@ -275,13 +275,28 @@ public:
|
|||
for (s = First(p); s.item; s = Next(s))
|
||||
{
|
||||
print_indent(0);
|
||||
Printf( out, "<base name=\"%s\" id=\"%ld\" addr=\"%x\" />\n", s.item, ++id, s.item );
|
||||
String *item_name = Xml_escape_string(s.item);
|
||||
Printf( out, "<base name=\"%s\" id=\"%ld\" addr=\"%x\" />\n", item_name, ++id, s.item );
|
||||
Delete(item_name);
|
||||
}
|
||||
indent_level -= 4;
|
||||
print_indent(0);
|
||||
Printf( out, "</baselist >\n" );
|
||||
}
|
||||
|
||||
String *Xml_escape_string(String *str) {
|
||||
String *escaped_str = 0;
|
||||
if (str) {
|
||||
escaped_str = NewString(str);
|
||||
Replaceall( escaped_str, "&", "&" );
|
||||
Replaceall( escaped_str, "<", "<" );
|
||||
Replaceall( escaped_str, "\"", """ );
|
||||
Replaceall( escaped_str, "\\", "\\\\" );
|
||||
Replaceall( escaped_str, "\n", " " );
|
||||
}
|
||||
return escaped_str;
|
||||
}
|
||||
|
||||
void Xml_print_module(Node *p)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue