runtest --xml produces invalid XML if test name contains special characters

Andrey ``Bass'' Shcheglov <[email protected]> Mon, 14 Aug 2017 19:03:01 +0300
Newsgroups gmane.comp.sysutils.dejagnu.bugs
Organization MIPT
Message-ID <[email protected]>
Hello,

Consider a test named "|i386 float AT&T mnemonic|" (taken from the
binutils package). Running this test with "runtest --xml" produces the
following XML fragment:
> |<test> <input></input> <output></output> <result>PASS</result>
> <name>i386 float AT&T mnemonic</name> <prms_id>0</prms_id> </test>|
Not that the '&' character is not escaped, and the resulting XML is not
valid. Here's how the above fragment should have looked like:
> |<test> <input></input> <output></output> <result>PASS</result>
> <name>i386 float AT&amp;T mnemonic</name> <prms_id>0</prms_id> </test>|
DejaGnu versions 1.5.1, 1.5.3 and 1.6 are affected.

Regards,
Andrey.