diff options
author | Russ Cox <rsc@golang.org> | 2010-04-28 19:29:20 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-04-28 19:29:20 -0700 |
commit | 0674a3a1706c9cbf452ad21045886cb8989437a9 (patch) | |
tree | a6a039ecdb5338622f161010006cd5fc464c807a /src/pkg/xml/xml.go | |
parent | 52d4d667d9589e756aa94ed714d471a3152715ea (diff) | |
download | golang-0674a3a1706c9cbf452ad21045886cb8989437a9.tar.gz |
xml: allow text segments to end at EOF
Fixes issue 674.
R=adg
CC=golang-dev
http://codereview.appspot.com/1018042
Diffstat (limited to 'src/pkg/xml/xml.go')
-rw-r--r-- | src/pkg/xml/xml.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pkg/xml/xml.go b/src/pkg/xml/xml.go index 1ad1039f6..44c42c035 100644 --- a/src/pkg/xml/xml.go +++ b/src/pkg/xml/xml.go @@ -758,9 +758,15 @@ func (p *Parser) text(quote int, cdata bool) []byte { p.buf.Reset() Input: for { - b, ok := p.mustgetc() + b, ok := p.getc() if !ok { - return nil + if cdata { + if p.err == os.EOF { + p.err = p.syntaxError("unexpected EOF in CDATA section") + } + return nil + } + break Input } // <![CDATA[ section ends with ]]>. |