Skip to content

Commit

Permalink
Don't leak a global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebarrie committed May 7, 2020
1 parent ac45fe7 commit 8813276
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/coderay/scanners/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def scan_tokens encoder, options
end
unless unicode
# check for unicode
$DEBUG_BEFORE, $DEBUG = $DEBUG, false
debug_before, $DEBUG = $DEBUG, false
begin
if check(/./mu).size > 1
# seems like we should try again with unicode
Expand All @@ -266,7 +266,7 @@ def scan_tokens encoder, options
rescue
# bad unicode char; use getch
ensure
$DEBUG = $DEBUG_BEFORE
$DEBUG = debug_before
end
next if unicode
end
Expand Down

0 comments on commit 8813276

Please sign in to comment.