ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.59k stars 660 forks source link

Fix file extension for versioned shared libraries #1233

Open gierens opened 1 year ago

gierens commented 1 year ago

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 commented 1 year ago

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

gierens commented 1 year ago

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.