diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index bc59bcdc..d1b9617e 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -211,8 +211,9 @@ def pull_event
#STDERR.puts @source.encoding
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
if @document_status == nil
+ pos = @source.pos
if @source.match("", true)
- return process_instruction
+ return process_instruction(pos)
elsif @source.match("/um, true)[1] ]
@@ -224,7 +225,7 @@ def pull_event
else
message = "#{base_error_message}: invalid name"
end
- @source.string = "/um, true)
@@ -325,7 +327,7 @@ def pull_event
else
message = "#{base_error_message}: invalid name"
end
- @source.string = " ]>
+ ]>
DETAIL
end