1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:54:41 -07:00

xml: fix innerxml handling of & escapes

R=r
CC=golang-dev
https://golang.org/cl/1009041
This commit is contained in:
Russ Cox 2010-04-26 10:01:33 -07:00
parent 13bb28a40a
commit 9f69ab39f0
2 changed files with 6 additions and 5 deletions

View File

@ -24,7 +24,7 @@ func TestUnmarshalFeed(t *testing.T) {
// hget http://codereview.appspot.com/rss/mine/rsc
const rssFeedString = `
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><li-nk href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></li-nk><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld</name></author><entry><title>rietveld: an attempt at pubsubhubbub
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><li-nk href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></li-nk><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld&lt;&gt;</name></author><entry><title>rietveld: an attempt at pubsubhubbub
</title><link hre-f="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html">
An attempt at adding pubsubhubbub support to Rietveld.
http://code.google.com/p/pubsubhubbub
@ -125,8 +125,8 @@ var rssFeed = Feed{
Id: "http://codereview.appspot.com/",
Updated: "2009-10-04T01:35:58+00:00",
Author: Person{
Name: "rietveld",
InnerXML: "<name>rietveld</name>",
Name: "rietveld<>",
InnerXML: "<name>rietveld&lt;&gt;</name>",
},
Entry: []Entry{
Entry{

View File

@ -795,8 +795,9 @@ Input:
var i int
CharLoop:
for i = 0; i < len(p.tmp); i++ {
p.tmp[i], p.err = p.r.ReadByte()
if p.err != nil {
var ok bool
p.tmp[i], ok = p.getc()
if !ok {
if p.err == os.EOF {
p.err = p.syntaxError("unexpected EOF")
}