summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-11-21 23:10:30 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-11-21 23:10:30 +0900
commit88d6009d91c197049da9d6efeb406aec5eb5d551 (patch)
treeaa2f0197bdc6e28e0f5bb556034674f9e0527e32 /lib
parentffab1bfdfcb9f1448c063e93f04209c90327ad9c (diff)
Use more strict regexp to avoid to match naninanirb.rb
Diffstat (limited to 'lib')
-rw-r--r--lib/irb.rb2
-rw-r--r--lib/irb/workspace.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index ed91d29..cbf717d 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -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
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index b7bd4c9..878bba9 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -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!