summaryrefslogtreecommitdiff
path: root/unxml.go
diff options
context:
space:
mode:
Diffstat (limited to 'unxml.go')
-rw-r--r--unxml.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/unxml.go b/unxml.go
index f2c970a..fee5690 100644
--- a/unxml.go
+++ b/unxml.go
@@ -126,9 +126,7 @@ func (r *Reader) Read(out []byte) (int, error) {
}
func (r *ElementReader) Read(out []byte) (int, error) {
- //fmt.Fprintf(os.Stderr, "Read has been called.\n")
var err error
- //r.intagtokeep = true
r.xr.count = 0
n := 0
@@ -140,11 +138,13 @@ func (r *ElementReader) Read(out []byte) (int, error) {
lenlr := len(r.xr.lastread)
if lenlr > 0 {
if lenlr < lenout {
+ //fmt.Printf("Using lastread: %q\n", r.xr.lastread)
n = copy(out[0:], r.xr.lastread)
r.xr.count += n
lenout -= n
r.xr.lastread = make([]byte, 0, lenout)
} else {
+ //fmt.Printf("Using lastread not enough: %q\n", r.xr.lastread)
n = copy(out[0:], r.xr.lastread[:lenout])
r.xr.lastread = r.xr.lastread[lenout:]
return n, err