From 76f963d0770a8f3dac68adfcc6cfbe91f9b88e21 Mon Sep 17 00:00:00 2001 From: nahi Date: Fri, 29 Mar 2002 11:52:09 +0000 Subject: [PATCH] Changed the regexp again to simplify code. See also [ruby-dev:16682]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/debug.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/debug.rb b/lib/debug.rb index f7eeac50cb..071840d65e 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -297,14 +297,9 @@ class Context stdout.print "Trace off.\n" end - when /^\s*b(?:reak)?\s+((?:.+:)?.+)$/ - pos = $1 - if pos.index(":") - pos = pos.split(":") - file = pos[0...-1].join(":") - pos = pos[-1] - end - file = File.basename(file) + when /^\s*b(?:reak)?\s+(?:(.+):)?(.+)$/ + pos = $2 + file = File.basename($1) if $1 if pos =~ /^\d+$/ pname = pos pos = pos.to_i