Skip to content

Commit

Permalink
Resolve symlinks when gathering libtool version.
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonmessmer committed Feb 1, 2023
1 parent a01b715 commit 41da0a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/elfdeps.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ typedef struct elfInfo_s {
static char *getLibtoolVer(const char *filename)
{
const char *so;
char dest[PATH_MAX];
int destsize = 0;
int found_digit, found_dot = 0;

destsize = readlink(filename, dest, PATH_MAX);
if (destsize > 0) {
dest[destsize] = 0;
filename = dest;
}
// Start from the end of the string. Verify that it ends with
// numbers and dots, preceded by ".so.".
so = filename + strlen(filename);
Expand Down

0 comments on commit 41da0a2

Please sign in to comment.