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

File.dirname normalization differs from MRI #2391

Closed
rjnienaber opened this Issue Dec 30, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@rjnienaber

rjnienaber commented Dec 30, 2014

From: http://jira.codehaus.org/browse/JRUBY-4863. Differs from MRI on JRuby 1.7.18 and JRuby 9000.

MRI strips additional leading slashes with File.dirname:

File.dirname("////foo/bar/baz") => /foo/bar (MRI)
File.dirname("////foo/bar/baz") => ////foo/bar (JRuby)

However, I'm not sure if this "normalization" is intentional in MRI or accidental, because it only seems to work on leading slashes in MRI:

File.dirname("////foo//bar/baz") => /foo//bar (MRI)
File.dirname("////foo//bar/baz") => ////foo//bar (JRuby)

I'd say the spec needs to be fleshed out. Either the path should be completely normalized, or not at all.

@rtyler

This comment has been minimized.

rtyler commented Aug 2, 2015

I've reproduced this with the latest 9k and 1.7.21 FWIW

@enebo enebo added this to the JRuby 9.2.0.0 milestone May 16, 2017

@enebo

This comment has been minimized.

Member

enebo commented May 16, 2017

I fixed this some time during 9.1.x and we have EOLd 1.7.x. Resolving.

@enebo enebo closed this May 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment