Skip to content

Commit

Permalink
Command.realpath should preserve / at the end of dir name
Browse files Browse the repository at this point in the history
  • Loading branch information
os97673 committed Aug 4, 2015
1 parent 9c9d987 commit 64cbfcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ruby-debug-ide/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,16 @@ def get_context(thnum)
end

def realpath(filename)
is_dir = filename.end_with?(File::SEPARATOR)
if filename.index(File::SEPARATOR) || File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
filename = File.expand_path(filename)
end
if (RUBY_VERSION < '1.9') || (RbConfig::CONFIG['host_os'] =~ /mswin/)
filename
else
File.realpath(filename) rescue filename
filename = File.realpath(filename) rescue filename
filename = filename + File::SEPARATOR if is_dir && !filename.end_with?(File::SEPARATOR)
filename
end
end
end
Expand Down

0 comments on commit 64cbfcd

Please sign in to comment.