diff options
author | Ben Elliston <bje@gnu.org> | 2017-08-19 13:12:47 +1000 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2017-08-19 13:12:47 +1000 |
commit | e301ae8ebdd5d07360501b05aa1075242ceef5c5 (patch) | |
tree | 8acaa4789f26ebe892f3668bb56155838c7b609d | |
parent | ddca6201c36d271de18de4010c1ecc46d9503ca6 (diff) | |
download | dejagnu-e301ae8ebdd5d07360501b05aa1075242ceef5c5.tar.gz dejagnu-e301ae8ebdd5d07360501b05aa1075242ceef5c5.tar.bz2 dejagnu-e301ae8ebdd5d07360501b05aa1075242ceef5c5.zip |
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).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/framework.exp | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -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. diff --git a/lib/framework.exp b/lib/framework.exp index b189a08..20e254a 100644 --- a/lib/framework.exp +++ b/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 { < < > > & & \" " ' ' } + 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> } |