diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 4111d1d3..9eeba273 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -161,6 +161,9 @@ def read end end + # Note: When specifying a string for 'pattern', it must not include '>' except in the following formats: + # - ">" + # - "XXX>" (X is any string excluding '>') def match( pattern, cons=false ) read if @scanner.eos? && @source while true @@ -170,7 +173,7 @@ def match( pattern, cons=false ) md = @scanner.check(pattern) end break if md - return nil if pattern.is_a?(String) && pattern.bytesize <= @scanner.rest_size + return nil if pattern.is_a?(String) return nil if @source.nil? return nil unless read end