fixed attempted modification of frozen string file_name

Under MRI 1.9, file_name comes from Method#source_location, which freezes the filename returned. This fix just reassigns file_name to the result of the gsub call, instead of sending gsub!.
This commit is contained in:
Eric Christopherson 2011-07-19 22:20:04 -05:00
parent f8835a9b2c
commit 0cbbb6206a
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ class Pry
end
def start_line_syntax_for_editor(file_name, line_number)
file_name.gsub!(/\//, '\\') if RUBY_PLATFORM =~ /mswin|mingw/
file_name = file_name.gsub(/\//, '\\') if RUBY_PLATFORM =~ /mswin|mingw/
case Pry.editor
when /^[gm]?vi/, /^emacs/, /^nano/, /^pico/, /^gedit/, /^kate/