Browse Source

Fix another bug reported by Andrey ``Bass'' Shcheglov.

* lib/framework.exp (xml_tag): Escape all of the non-printable control
  characters (ASCII codes 1 to 31 inclusive).
dejagnu-1.6.1
Ben Elliston 9 years ago
parent
commit
e301ae8ebd
  1. 5
      ChangeLog
  2. 6
      lib/framework.exp

5
ChangeLog

@ -1,3 +1,8 @@
2017-08-19 Ben Elliston <bje@gnu.org>
* lib/framework.exp (xml_tag): Escape all of the non-printable
control characters (ASCII codes 1 to 31 inclusive).
2017-08-18 Tom Tromey <tom@tromey.com>
* runtest.exp: Fix --directory matching.

6
lib/framework.exp

@ -366,6 +366,12 @@ proc log_and_exit {} {
# Emit an XML tag, but escape XML special characters in the body.
proc xml_tag { tag body } {
set escapes { < &lt; > &gt; & &amp; \" &quot; ' &apos; }
for {set i 1} {$i < 32} {incr i} {
# Append non-printable character
lappend escapes [format %c $i]
# .. and then the corresponding XML escape
lappend escapes &#[format %x $i]\;
}
return <$tag>[string map $escapes $body]</$tag>
}

Loading…
Cancel
Save