So seems like the main difference is just that on Ubuntu the first entry doesn't have a name, and those are explicitly skipped in my code (
https://github.com/vtjnash/libwhich/blob/a11efad57d90fdb95790312d90c8f66d803125cf/libwhich.c#L200)
Indeed, the example in the Ubuntu manpage also clarifies that: "The first shared object for which output is displayed (where the name is an empty string) is the main program"
Which seems to suggest that users should just unconditionally skip the first entry if they aren't interested in the program name. Does that sound right?
-Jameson
> Rather than special-casing knowledge of particular systems I think the
> code should just be fixed so that it doesn't break if the main program
> is included.
I'm CC'ing the libwhich people so let them know and discuss.
For context - http://www.openwall.com/lists/musl/2018/05/28/1