mirror of https://github.com/swig/swig
Fixed xml sym:name problem.
**** SPECIAL CAUTION TO DEVELOPERS **** The strings that represent attribute key names like "name", "sym:name", "type", and so forth are extensively shared to save memory. If a key name is modified for some reason (which is not recommended), be aware that those change may affect thousands of parse tree nodes. Moreover, changes to a key name will break the hashing algorithm used to perform attribute lookup. Bottom line: don't modify hash table key strings. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cbfec5e059
commit
3851e222d0
|
@ -178,21 +178,25 @@ public:
|
|||
print_indent(0);
|
||||
if (DohIsString(Getattr(obj,k)))
|
||||
{
|
||||
String *ck = NewString(k);
|
||||
o = Str(Getattr(obj,k));
|
||||
Replaceall( k, ":", "_" );
|
||||
Replaceall( ck, ":", "_" );
|
||||
/* Do first to avoid aliasing errors. */
|
||||
Replaceall( o, "&", "&" );
|
||||
Replaceall( o, "<", "<" );
|
||||
Replaceall( o, "\"", """ );
|
||||
Replaceall( o, "\\", "\\\\" );
|
||||
Printf(out,"<attribute name=\"%s\" value=\"%s\" id=\"%ld\" addr=\"%x\" />\n", k, o, ++id, o );
|
||||
Printf(out,"<attribute name=\"%s\" value=\"%s\" id=\"%ld\" addr=\"%x\" />\n", ck, o, ++id, o );
|
||||
Delete(o);
|
||||
Delete(ck);
|
||||
}
|
||||
else
|
||||
{
|
||||
o = Getattr(obj,k);
|
||||
Replaceall( k, ":", "_" );
|
||||
Printf(out,"<attribute name=\"%s\" value=\"%x\" id=\"%ld\" addr=\"%x\" />\n", k, o, ++id, o );
|
||||
String *ck = NewString(k);
|
||||
Replaceall( ck, ":", "_" );
|
||||
Printf(out,"<attribute name=\"%s\" value=\"%x\" id=\"%ld\" addr=\"%x\" />\n", ck, o, ++id, o );
|
||||
Delete(ck);
|
||||
}
|
||||
}
|
||||
k = Nextkey(obj);
|
||||
|
|
Loading…
Reference in New Issue