Skip to content

Commit 0990c7a

Browse files
committed
Fixing realpath conversion for JRuby on Windows
On Windows we should not convert path to realpath for JRuby because canonical path will contain \ while Ruby always uses / and after this conversion we do not stop on breakpoints :( Also JRUBY_VERSION may not be initialised at this point (at least for initial breakpoint it is not :(
1 parent 7117f57 commit 0990c7a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/ruby-debug-ide/commands/breakpoints.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'pathname' if RUBY_VERSION < '1.9'
2-
31
module Debugger
42
class AddBreakpoint < Command # :nodoc:
53
self.control = true
@@ -69,9 +67,7 @@ def help(cmd)
6967
def realpath(filename)
7068
filename = File.expand_path(filename) if filename.index(File::SEPARATOR) || \
7169
File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
72-
if defined?(JRUBY_VERSION)
73-
java.io.File.new(filename).canonical_path
74-
elsif RUBY_VERSION < '1.9'
70+
if (RUBY_VERSION < '1.9') || (RbConfig::CONFIG['host_os'] =~ /mswin/)
7571
filename
7672
else
7773
File.realpath(filename)

0 commit comments

Comments
 (0)