]> Cypherpunks repositories - gostls13.git/commitdiff
xml: fix innerxml handling of & escapes
authorRuss Cox <rsc@golang.org>
Mon, 26 Apr 2010 17:01:33 +0000 (10:01 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 26 Apr 2010 17:01:33 +0000 (10:01 -0700)
R=r
CC=golang-dev
https://golang.org/cl/1009041

src/pkg/xml/read_test.go
src/pkg/xml/xml.go

index 68bb010f2f247e3b170df65f1407ffc848541361..97fa423d6ac1135a6f7905f58aca7a597db75944 100644 (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{
index 410b0f77cac1efcf7bd4e2ad6e9dc1c1e951e788..1ad1039f6443af22d9ed5045c3d13d477c30d689 100644 (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")
                                        }