Skip to content

Commit

Permalink
Add missing encode for custom term
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 2, 2024
1 parent f59790b commit 4444a04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rexml/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def initialize(arg, block_size=500, encoding=nil)
end

def read(term = nil)
term = encode(term) if term
begin
@scanner << readline(term)
true
Expand All @@ -174,6 +175,7 @@ def read(term = nil)

def read_until(term)
pattern = /#{Regexp.escape(term)}/
term = encode(term)
begin
until str = @scanner.scan_until(pattern)
@scanner << readline(term)
Expand Down

0 comments on commit 4444a04

Please sign in to comment.