[前][次][番号順一覧][スレッド一覧]

ruby-changes:58878

From: Kazuhiro <ko1@a...>
Date: Thu, 21 Nov 2019 23:11:55 +0900 (JST)
Subject: [ruby-changes:58878] 88d6009d91 (master): Use more strict regexp to avoid to match naninanirb.rb

https://git.ruby-lang.org/ruby.git/commit/?id=88d6009d91

From 88d6009d91c197049da9d6efeb406aec5eb5d551 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Thu, 21 Nov 2019 23:10:30 +0900
Subject: Use more strict regexp to avoid to match naninanirb.rb


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 https://github.com/ruby/ruby/blob/trunk/lib/irb.rb#L553
     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 https://github.com/ruby/ruby/blob/trunk/lib/irb/workspace.rb#L124
 
     # 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!
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]