-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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.extname considers the whole path as a filename #5780
Comments
It's really disturbing this hasn't been noticed before... Judging from the documentation it seems like this method is supposed to receive only a filename, not an entire path. So you'd be expected to use it as |
In Ruby it returns |
@Sija That's a different thing, please open a new issue if you want to change that. |
@Sija In Ruby |
Agreed - it must be a behaviour bug then. The output ".bar/baz" can quite logically never be an "extension name". I don't |
puts File.extname("/foo.bar/baz")
Expected output:
""
Actual output:
".bar/baz"
Crystal 0.24.1
The text was updated successfully, but these errors were encountered: