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

Fix file extension for versioned shared libraries #1233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gierens
Copy link

@gierens gierens commented Aug 11, 2023

Revise File::ext to extract "so" extension from versioned shared libraries, so instead of returning "3" for "libtest.so.1.2.3" it returns "so".

The parsing only kicks in when the last extension is a numeric value, and then keeps on going back through the numbers until it finds the "so" or not. Only checking for numbers after the "so" should be sufficient for nearly all libs. I only found two exceptions in my /usr/lib, some .so.owner and a .so.sign. Trying to match those would require a much more general approach which doesn't seem to be worth it here.

Resolves #1105

@ariasuni
Copy link
Collaborator

Would you like re-open that PR but for eza?

@gierens
Copy link
Author

gierens commented Oct 3, 2023

Ah, yeah right ... I'll probably do that ... but I'll have to think about it for a bit because this is just one tiny special case of so many. And actually when I wrote this PR I was already considering whether there is a way to handle multipart extensions in a general fashion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with penguin icon
2 participants