You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jruby-9.0.0.0 :007 > x = "joe"
=> "joe"
jruby-9.0.0.0 :008 > y = "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
=> "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
jruby-9.0.0.0 :009 > Pathname.new(y).relative_path_from(Pathname.new(x))
TypeError: no implicit conversion from nil to integer
from org/jruby/RubyString.java:2870:in []' from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:48:inchop_basename'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:113:in cleanpath_aggressive' from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:91:incleanpath'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:493:in relative_path_from' from (irb):9:in'
from org/jruby/RubyKernel.java:979:in eval' from org/jruby/RubyKernel.java:1292:inloop'
from org/jruby/RubyKernel.java:1099:in catch' from org/jruby/RubyKernel.java:1099:incatch'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/bin/irb:13:in `'
this bug slipped quite into oblivion - its an ugly piece show-casing String#rindex isn't working properly for certain UTF-8 strings. c24f7fa resolved the issue.
jruby-9.0.0.0 :007 > x = "joe"
=> "joe"
jruby-9.0.0.0 :008 > y = "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
=> "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
jruby-9.0.0.0 :009 > Pathname.new(y).relative_path_from(Pathname.new(x))
TypeError: no implicit conversion from nil to integer
from org/jruby/RubyString.java:2870:in []' from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:48:inchop_basename'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:113:in cleanpath_aggressive' from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:91:incleanpath'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/pathname.rb:493:in relative_path_from' from (irb):9:in'
from org/jruby/RubyKernel.java:979:in eval' from org/jruby/RubyKernel.java:1292:inloop'
from org/jruby/RubyKernel.java:1099:in catch' from org/jruby/RubyKernel.java:1099:incatch'
from /services/medusa/.rvm/rubies/jruby-9.0.0.0/bin/irb:13:in `'
Here's the MRI version, which works:
2.2.3 :006 > x = "joe"
=> "joe"
2.2.3 :007 > y = "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
=> "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
2.2.3 :008 > Pathname.new(y).relative_path_from(Pathname.new(x))
=> #Pathname:⸀䐀攀氀攀琀攀䴀攀/fred
I discovered this at the same time as issue #3392. They appear to be different problems, though.
The text was updated successfully, but these errors were encountered: