Skip to content

Commit 64cbfcd

Browse files
committed
Command.realpath should preserve / at the end of dir name
1 parent 9c9d987 commit 64cbfcd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ruby-debug-ide/command.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,16 @@ def get_context(thnum)
152152
end
153153

154154
def realpath(filename)
155+
is_dir = filename.end_with?(File::SEPARATOR)
155156
if filename.index(File::SEPARATOR) || File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
156157
filename = File.expand_path(filename)
157158
end
158159
if (RUBY_VERSION < '1.9') || (RbConfig::CONFIG['host_os'] =~ /mswin/)
159160
filename
160161
else
161-
File.realpath(filename) rescue filename
162+
filename = File.realpath(filename) rescue filename
163+
filename = filename + File::SEPARATOR if is_dir && !filename.end_with?(File::SEPARATOR)
164+
filename
162165
end
163166
end
164167
end

0 commit comments

Comments
 (0)