summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-29 11:52:09 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-29 11:52:09 +0000
commit018f459ce71e37d6605039adad5ae972081a21a8 (patch)
tree9a0ebda83d7c950eeab4eec9e8ca29d5b5a0f53d
parentb8460da7fc67e50c0a4c46e6053f53ed9e514394 (diff)
downloadruby-018f459ce71e37d6605039adad5ae972081a21a8.tar.gz
ruby-018f459ce71e37d6605039adad5ae972081a21a8.tar.xz
ruby-018f459ce71e37d6605039adad5ae972081a21a8.zip
Changed the regexp again to simplify code. See also [ruby-dev:16682].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/debug.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/debug.rb b/lib/debug.rb
index f7eeac50c..071840d65 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