Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathname#relative_path_from failing when there are certain unicode characters in the path #3396

hading opened this issue Oct 14, 2015 · 1 comment


Copy link

hading commented Oct 14, 2015

jruby- :007 > x = "joe"
=> "joe"
jruby- :008 > y = "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
=> "joe/⸀䐀攀氀攀琀攀䴀攀/fred"
jruby- :009 >
TypeError: no implicit conversion from nil to integer
from org/jruby/ []' from /services/medusa/.rvm/rubies/jruby-'
from /services/medusa/.rvm/rubies/jruby- cleanpath_aggressive' from /services/medusa/.rvm/rubies/jruby-'
from /services/medusa/.rvm/rubies/jruby- relative_path_from' from (irb):9:in'
from org/jruby/ eval' from org/jruby/'
from org/jruby/ catch' from org/jruby/'
from /services/medusa/.rvm/rubies/jruby- `'

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:⸀䐀攀氀攀琀攀䴀攀/fred

I discovered this at the same time as issue #3392. They appear to be different problems, though.

@kares kares self-assigned this Jun 23, 2017
kares added a commit that referenced this issue Jun 23, 2017
upper bound check should not halt the loop since we're going pos--
(and there's a chance were able to find a match at a lower position)
@kares kares added this to the JRuby milestone Jun 23, 2017
Copy link

kares commented Jun 23, 2017

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.

@kares kares closed this as completed Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants