1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use more strict regexp to avoid to match naninanirb.rb

This commit is contained in:
Kazuhiro NISHIYAMA 2019-11-21 23:10:30 +09:00
parent ffab1bfdfc
commit 88d6009d91
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A
2 changed files with 3 additions and 3 deletions

View file

@ -553,7 +553,7 @@ module IRB
end
def handle_exception(exc)
if exc.backtrace && exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
if exc.backtrace && exc.backtrace[0] =~ /\/irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
!(SyntaxError === exc)
irb_bug = true
else

View file

@ -124,8 +124,8 @@ EOF
# error message manipulator
def filter_backtrace(bt)
return nil if bt =~ /irb\/.*\.rb/
return nil if bt =~ /irb\.rb/
return nil if bt =~ /\/irb\/.*\.rb/
return nil if bt =~ /\/irb\.rb/
case IRB.conf[:CONTEXT_MODE]
when 1
return nil if bt =~ %r!/tmp/irb-binding!